概述
mysql> desc test1
-> ;
+-------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
+-------+------------------+------+-----+---------+----------------+
mysql> desc test2;
+---------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+----------------+
| id | int(11) unsigned | NO | PRI | NULL | auto_increment |
| ids_str | varchar(32) | YES | | NULL | |
+---------+------------------+------+-----+---------+----------------+
ids_str是一个字符串。
ids_str="1,2,3"
select * from test1 where id in (select ids_str from test2)
即:
select * from test1 where id in ("1,2,3")
最后
以上就是冷酷小猫咪为你收集整理的mysql ids查询_mysql where in (select ids_str from test)如何查询的全部内容,希望文章能够帮你解决mysql ids查询_mysql where in (select ids_str from test)如何查询所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复