Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to search for a string in all stored procedure in sql server?

949


Explain what are the different index configurations a table can have?

1037


How to execute multiple stored procedures at one time in sql server?

941


What does null mean?

935


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

1125


What are the functions in sql server?

900


Explain what is “asynchronous” communication in sql server service broker?

866


Define left outer join?

920


Why we should not use triggers?

918


What is an execution plan? How would you view the execution plan?

1012


Explain throw statement in sql server 2008?

930


How do you create type- insensitive operator?

993


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1945


How is table type constraint applied to a table?

932


After removing a table from database, what other related objects have to be dropped explicitly?

997