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 search for a string in all stored procedure in sql server?
Explain what are the different index configurations a table can have?
How to execute multiple stored procedures at one time in sql server?
What does null mean?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
What are the functions in sql server?
Explain what is “asynchronous” communication in sql server service broker?
Define left outer join?
Why we should not use triggers?
What is an execution plan? How would you view the execution plan?
Explain throw statement in sql server 2008?
How do you create type- insensitive operator?
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
How is table type constraint applied to a table?
After removing a table from database, what other related objects have to be dropped explicitly?