我想写一个MySql查询,我希望使用AND和OR的组合.我有6个属性,其中我想要一个String出现,并且有一个属性,其中应该出现一个强制线程.
我的命令看起来像这样.
Select * from Students where roll_no like '__2011%' and subject1 ='maths' or subject2='maths' or subject3='maths' or subject4='maths' or subject5='maths' or subject6='maths';
Run Code Online (Sandbox Code Playgroud)
我希望"数学"出现在至少一个主题属性中.与该卷一起,不应该在查询中指定2011.请帮我.
Select * from Students where roll_no like '__2011%' and (subject1 ='maths' or subject2='maths' or subject3='maths' or subject4='maths' or subject5='maths' or subject6='maths');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2686 次 |
| 最近记录: |