所以我有一张 table
书籍
id, name, organisationId, status
所以,现在我要获取的是 organizationId 为 3 的书籍。 这是...
SELECT * FROM books where id= '3'
问题是我想不出一种方法,无论 organizationId 是什么,我都可以获得状态为公开的书籍。
我刚开始了解 mysql 查询,这就是我问这个问题的原因,以便我能够理解。
最佳答案
将 and
与 where 子句一起使用,与使用 or
代替 and
SELECT * FROM books where id= 3 and status like '%public%'
关于mysql - 如何编写条件 mysql 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52478578/