有没有一种方法可以选择多个条件中的任何一个出现在同一字段上的数据?
示例:我通常会写这样的语句:
select * from TABLE where field = 1 or field = 2 or field = 3
有没有办法改为这样说:
select * from TABLE where field = 1 || 2 || 3
感谢任何帮助。
最佳答案
当然,最简单的方法是这样的:
select foo from bar where baz in (1,2,3)
关于mysql - 选择 ..... 其中 .... 或,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17870/