Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL查询转换_Mysql - Fatal编程技术网

MySQL查询转换

MySQL查询转换,mysql,Mysql,我在mysql查询中得到了这个输出(有键值对) 如何将其转换为(单线) 查看一下从t GROUP BY Id中选择Id、GROUP_CONCAT(按名称描述的值顺序)@Mihai请注意,使用GROUP_CONCAT时,值位于结果集中的同一字段中,例如,您需要一个分隔符,然后处理结果。 -id NAME VALUE --1 customerName Narendra --1 customerCountry India id customerName country

我在mysql查询中得到了这个输出(有键值对)

如何将其转换为(单线)


查看一下
从t GROUP BY Id中选择Id、GROUP_CONCAT(按名称描述的值顺序)
@Mihai请注意,使用
GROUP_CONCAT
时,值位于结果集中的同一字段中,例如,您需要一个分隔符,然后处理结果。
-id NAME            VALUE
--1 customerName    Narendra
--1 customerCountry India
id customerName  country
1   Narendra        India