Results 1 to 2 of 2

Thread: T-SQL Query Q

  1. #1
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    144

    Unanswered: T-SQL Query Q

    Is it possible to write a query to include more than 2 values in a subquery using In ?

    declare @LDN as varchar(30)
    set @LDN = ('76444' + ',' + '13333')

    select timeslot,count(*),
    (sum(datediff(ss, tblCallDetail.tcallAnswered, tblCallDetail.tCallReleased))/count(*) )as AveCalltime
    from tblcalldetail
    where
    Cast(szCalledParty as varchar(30)) in (select @LDN)

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    There are several ways:
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25830

    I tend to use a table returning Split function (each value = one row) - not sure if this is one of the suggested methods.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •