Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Help in query please

$
0
0

Hi, How I can get the desired output. Every record should be with single quotation and next record aftercomma. '(' should be in starting and ')' should be in the end and 10 records in each row. I would be much appreciated. Thanks.

create table #t1 (t1 char(6))

insert into #t1 values ('301300')

insert into #t1 values ('302300')

insert into #t1 values ('303300')

insert into #t1 values ('304300')

insert into #t1 values ('305300')

insert into #t1 values ('306300')

insert into #t1 values ('307300')

insert into #t1 values ('308300')

insert into #t1 values ('310300')

insert into #t1 values ('320300')

insert into #t1 values ('299300')

insert into #t1 values ('390300')

--Desired output if I run the query:


('301300','302300','303300','304300','305300','306300','307300','308300','310300','320300',

'299300','390300')




Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>