select * from article,user where article.userid = '1' and article.userid = user.userid or article.userid = '2' and article.userid = user.userid or article.userid = '3' and article.userid = user.userid or article.userid = '4' and article.userid = user.userid or article.userid = '5' and article.userid = user.userid ORDER BY articleid DESC也就是说,userid 会有很多,请问可以精简吗?
解决方案 »
- MySQL 表别名难道还有缓存功能?
- 数据库系统概论试题 求高手解答
- 如何根据id把一个表的某列update给另一个表的相应列?
- 如何合并字段不同的表?(结构见示例)
- 我的mysql-front没有字了,怎么办?
- 涉猎 MySQL 和 C# 的兄弟姐妹们来看看
- 请问Mysql不能输入繁体的“餐”是由于什么原因造成的?怎么解决?
- 一个表格的设计问题!问题解决立即给分!
- MySqlTransaction中的commit(),如果服务器中断未执行到这步,数据会提交吗?
- 请教mysql innodb表的自增主键重置问题
- MySQL 存储过程异常获取错误码及错误信息
- mysql怎么判断是否为整数?做到整数输出A样式,非整数输出B样式?
where article.userid = user.userid
and article.userid in ('1', '2', '3', '4', '5')
ORDER BY articleid DESC
select * from article,user
where article.userid = user.userid or article.userid in ('1','2','3','4','5')
ORDER BY articleid DESC
这样?
当然还是推荐写括号