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 find Duplicate Records In table?
what is raid and what are different types of raid configurations? : Sql server database administration
What is the native system stored procedure to execute a command against all databases?
Why we use the openxml clause?
How to recompile stored procedure at run time?
How to turn off warning messages during php execution?
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
What should be the fill factor for indexes created on tables? : sql server database administration
if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration
Why use “in” clause in sql server?
What is tablesample?
What is parameterized reports in ssrs ?
What happens when unicode strings concatenate with non-unicode strings?
How to define the name and server for a new dsn?
What are SSL and TSL protocols?