Hi all,
I need query help for below senorio, could you please help
me.
TableName = City
CITYID ContinuationID CITYNAME
1 1 SAN
1 2 DIEGO
2 1 SAN
2 2 FRANCISCO
3 1 CHICAGO
4 1 NEW
4 2 YORK
4 3 CITY
Could you please help me to write a generalized SQL that
returns results as given below in the
Query result
CITYID NAME1 NAME2 NAME3 NAME4 NAME5
1 SAN DIEGO
2 SAN FRANCISCO
3 CHICAGO
4 NEW YORK CITY
Answer Posted / das
select cityid,group_concat(cityname) as city from city group by cityid;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How to rebuild master databse?
What are “lost updates”?
What is difference between count (*) and count 1?
How to create a testing table with test data in ms sql server?
Explain what are page splits? : SQL Server Architecture
What is a data source file?
What is the server name for sql management studio?
How many types of triggers in sql server?
Find first and last day of current month in sql server
Do you know concepts and capabilities of sql server?
What are commit and rollback in sql?
How to create hyperlink from returned sql query ?
What is the significance of master, tempdb and model databases?
How to get a list of all tables with "sys.tables" view in ms sql server?
What is the maximum size of column in sql server?