Posts

Showing posts from July 12, 2018
This is good example. CONVERT COLUMN VALUES TO COMMA SEPARATED ONE ROW VALUE I have a query the returns country....state...and cities  the cities are creating ore rows than required, I need to re-write my query so that the cities column instead come in single row separated by commas... here is the data for more understanding CREATE TABLE [ dbo ].[ test12 ]( [ title ] [ varchar ]( 51 ) NULL , [ subtitle ] [ varchar ]( 52 ) NULL , [ value ] [ varchar ]( 53 ) NULL ) INSERT INTO test12 ( title , subtitle , value ) VALUES ( 'USA' , 'PA' , 'PHILLY' ) INSERT INTO test12 ( title , subtitle , value ) VALUES ( 'USA' , 'PA' , 'PITTSBURG' ) INSERT INTO test12 ( title , subtitle , value ) VALUES ( 'USA' , 'PA' , 'WARREN' ) INSERT INTO test12 ( title , subtitle , value ) VALUES ( 'USA' , 'PA' , 'UNION' ) INSERT INTO test12 ( title , subtitle