home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,322 of 19,505   
   Gene Wirchenko to broy@omegasoftwareinc.com   
   Re: Get comma separated list of integers   
   17 May 11 11:17:40   
   
   0d0608b7   
   From: genew@ocis.net   
      
   On Tue, 17 May 2011 07:41:00 -0700 (PDT), BobRoyAce   
    wrote:   
      
   >The following query will return one row for each pkLoanID present in   
   >the queried table:   
   >   
   >SELECT pkLoanID FROM Loans   
   >   
   >So, if there were three records, I would get back three records.   
   >   
   >What I want is a query that will instead return just a single row/   
   >value which would equal a comma-separated list of the pkLoanID values   
   >(e.g. 1,2,3).   
   >   
   >How can I accomplish with with SQL?   
      
       select * from Loans where pkLoanID in (1,2,3)   
      
   Sincerely,   
      
   Gene Wirchenko   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca