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 rebuild master databse?

1092


What are “lost updates”?

1008


What is difference between count (*) and count 1?

936


How to create a testing table with test data in ms sql server?

1092


Explain what are page splits? : SQL Server Architecture

1074


What is a data source file?

982


What is the server name for sql management studio?

1034


How many types of triggers in sql server?

1040


Find first and last day of current month in sql server

1033


Do you know concepts and capabilities of sql server?

1071


What are commit and rollback in sql?

1137


How to create hyperlink from returned sql query ?

1133


What is the significance of master, tempdb and model databases?

1085


How to get a list of all tables with "sys.tables" view in ms sql server?

1041


What is the maximum size of column in sql server?

901