Monday, 15 June 2015

mysql - Subquery to String? -


I have a table with a country:

  ID country ------- ----- 0 Monaco 1 Mongolia 2 Montenegro 3 Morocco 4 Mozambique 5 Myanmar  

I have a sub-question that looks like this.

  (SELECT country from country where id & lt; 10) such as 'trip'  

I think that subquery is such a string Is formatted as:

'Monaco, Mongolia, Montenegro, Morocco, Mozambique, Myanmar'

Is it possible?

You can use the function:

  SELECT group_concat ( Country, ',') WHERE id & lt; 10  

No comments:

Post a Comment