Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/71.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 不带where条件按循环更新列值_Mysql - Fatal编程技术网

Mysql 不带where条件按循环更新列值

Mysql 不带where条件按循环更新列值,mysql,Mysql,我有下表,大约15000行: +--------------+-------------+ | member_index | member_id | +--------------+-------------+ | 59084 | | | 155647 | -8zkkozg | | 140550 | -sanofi- | | 153323 | ..pgdpta | 我需要在每一行上循环以更新成员索引

我有下表,大约15000行:

+--------------+-------------+
| member_index | member_id   |
+--------------+-------------+
|        59084 |             |
|       155647 | -8zkkozg    |
|       140550 | -sanofi-    |
|       153323 | ..pgdpta    |
我需要在每一行上循环以更新成员索引,而不需要
where
条件,或者
where
具有类似偏移量的条件,只需要从第一条记录循环到最后更新它

这不可能吗

//更新预期输出:

+--------------+-------------+
| member_index | member_id   |
+--------------+-------------+
|   59084_abcd |             |
|   55647_efgh | -8zkkozg    |
|  140550_ijkl | -sanofi-    |
|  153323_gmop | ..pgdpta    |
追加部分(
\u efgh
..)是从过程中获取的

declare append varchar(20)
CALL getAppendPart(append)

for loop ..//this part what I need to ask

   UPDATE table tbl set member_index = concat(member_index ,append)
使用MySQL
concat()
:-

update table set member_index=concat(member_index,'_',
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 
rand(@seed:=round(rand(@lid)*4294967296))*36+1, 4))
使用MySQL
concat()
:-

update table set member_index=concat(member_index,'_',
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 
rand(@seed:=round(rand(@lid)*4294967296))*36+1, 4))

您能为我们提供示例输出吗?谢谢,期望输出更新这就是您正在查看的
更新表\u name set member\u index=concat(member\u index,“'u suff')
?以及从何处生成成员索引的
abcd,efgh,…
?附加部分(\u efgh…)是从一个过程中获得的吗,预期输出更新这就是您正在查看的
更新表\u name set member\u index=concat(member\u index,''u suff')
?从哪里生成成员索引的
abcd,efgh,…
?追加部分(\u efgh…)是从过程中获取的,我在预期输出中有错误,更新部分对于每个rowI更新的问题不相同,以便更清楚,因此很抱歉:(抱歉,我在预期输出中有错误,更新部分对于每个rowI更新的问题不相同,以便更清楚,因此很抱歉:(