Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/73.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
如何从group_concat mysql的结果中逐个获取值?_Mysql_Sql - Fatal编程技术网

如何从group_concat mysql的结果中逐个获取值?

如何从group_concat mysql的结果中逐个获取值?,mysql,sql,Mysql,Sql,例如,我使用group\u concat 示例结果是: SELECT GROUP_CONCAT(customerid) FROM customers; 输出为: 121,123,60,24,56,78,45,67,143,etc 基于customerid,我现在想更新另一个表中的一些详细信息。不要使用group\u concat()。使用子查询或联接。大概是这样的: update othertable set col = value where customerid in

例如,我使用
group\u concat

示例结果是:

SELECT GROUP_CONCAT(customerid) FROM customers;
输出为:

121,123,60,24,56,78,45,67,143,etc 

基于customerid,我现在想更新另一个表中的一些详细信息。

不要使用
group\u concat()
。使用子查询或
联接
。大概是这样的:

update othertable
    set col = value
    where customerid in (select customerid from customers);

另一个选项是在表之间进行连接,而不是使用子查询:-

UPDATE fcl_bl a
INNER JOIN notes b
ON a.file_number = b.module_ref_id
AND b.module_id = 'file' 
AND b.note_desc LIKE '%(Received SSL Master -> Yes to No)%'
SET a.received_master='Yes' 
WHERE received_master='No'

否,先生,我的实际查询如下..更新fcl_bl SET接收到的_master='Yes',其中文件号在选择组_CONCAT(模块_ref_id分隔符';')中,其中模块_id='file'和注释_desc如“%”(接收到的SSL master->Yes to no)%”和接收到的_master='no';谢谢您的回答。您的查询已执行。但它不会影响fcl_bl表中的任何行。请发布表声明和两行示例行,好吗?