gpt4 book ai didi

mysql - 从硬编码列表 MySql 中查询

转载 作者:行者123 更新时间:2023-11-28 23:52:41 25 4
gpt4 key购买 nike

我该怎么做?我想从硬编码列表中查询?

select (222,
333,
444,
555,
666,
777,
777,
88,
999,
099) as imageids

最佳答案

您可以创建多行,每行包含一个图像 ID:

select 222 as imageid
union select 333
union select 444
union select 555
union select 666
union select 777
union select 777
union select 88
union select 999
union select 099

或返回包含所有图像 ID 的逗号分隔字符串:

select group_concat(222, 333, 444, 555, 666, 777, 88, 999, 099) as imageids

请注意,099 的值将作为 99 返回,因为它将被视为整数。如果您需要保留前导零,则应使用字符串值(即 "099" 而不是 099)。

关于mysql - 从硬编码列表 MySql 中查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32384576/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com