我有一个类似这样的Select查询
SELECT * FROM table WHERE id = ?
Run Code Online (Sandbox Code Playgroud)
我需要一个排除特定结果的条件.
if(type = 'tv' and that type's code = '123')
然后从选择结果中排除该行.由于我的SQL技能不是很强,我不确定如何实现这一点.
SELECT * FROM table WHERE id = ? AND not(type = 'tv' and code = '123')
Run Code Online (Sandbox Code Playgroud)
这是你要找的?
type <> 'tv' and code <> '123' 和 之间有区别
not(type = 'tv' and code = '123')
| 归档时间: |
|
| 查看次数: |
13655 次 |
| 最近记录: |