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
Why use “pivot” in sql server?
difference between Clustered index and non clustered index ?
What is the difference between dbcc indexdefrag and dbcc reindex?
Can a function call a stored procedure in sql server?
How can sql server instances be hidden? : sql server security
What is blocking and how would you troubleshoot it? : sql server database administration
What is collation sensitivity?
What are the advantages of paper records?
What do you understand by replication in sql server?
What does the update command do?
What encryption security is available in sql azure?
What do you need to connect php to sql server?
What is the boxing and unboxing concept in .net?
What is the new security features added in sql server 2014? : sql server security
What is log in sql server?