我有以下查询
select * from user_profile
现在我想添加条件检查其他表(用户)的用户状态
select * from user_profile,users where users.status!=0
请不要推荐按照旧的加入查询加入我
谢谢
最佳答案
如果不想使用联接,则必须使用子查询。我猜两个表都有一个类似 userId
:
select * from user_profile where userId in (select userId from users where status != 0)
关于mysql - 从其他表查询检查状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47691528/