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 find Duplicate Records In table?

1072


what is raid and what are different types of raid configurations? : Sql server database administration

1105


What is the native system stored procedure to execute a command against all databases?

1087


Why we use the openxml clause?

1056


How to recompile stored procedure at run time?

1118


How to turn off warning messages during php execution?

1107


What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas

1321


What should be the fill factor for indexes created on tables? : sql server database administration

1180


if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration

1041


Why use “in” clause in sql server?

1124


What is tablesample?

1177


What is parameterized reports in ssrs ?

163


What happens when unicode strings concatenate with non-unicode strings?

1185


How to define the name and server for a new dsn?

1196


What are SSL and TSL protocols?

1034