jpg
3 c.jpg
2 b表 img
字段 id img
值 1 a.jpg
这样查询 SELECt * from img where id = 1
SELECt * from img where id = 2
怎么样把这两条合成一句sql
mysql一条语 查询多条合并到一起
答案:2 悬赏:50
解决时间 2021-03-09 10:50
- 提问者网友:他的思颖
- 2021-03-09 02:31
最佳答案
- 二级知识专家网友:我们只是兮以城空
- 2021-03-09 03:51
SELECt * from img where id = 1 or id = 2
或者
改为
SELECt * from img where id in (1,2)
又或者
SELECt * from img where id = 1
union
SELECt * from img where id = 2
或者
改为
SELECt * from img where id in (1,2)
又或者
SELECt * from img where id = 1
union
SELECt * from img where id = 2
全部回答
- 1楼网友:为你轻狂半世殇
- 2021-03-09 04:16
不明白啊 = =!
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯