我写了这个查询,但它似乎是一个非常糟糕的查询,缩短MySQL的情况下查询
select * from games_applied where
games_post_id='1126' and status != '4' and
(status != '5' and rejected_status = '0' or status = '5' and rejected_status = '1');
如何利用这种情况下的一种更好的方式。
(status != '5' and rejected_status = '0' or status = '5' and rejected_status = '1')
应该只显示其具有rejected_status = 1个状态= 5 并且不应该显示其具有rejected_Status = 0和状态= 5
能否请您给一个小的描述,你希望得到尽可能输出什么?请添加表结构,以便它更有帮助。 –
*但它似乎是一个非常糟糕的查询* - ***为什么?*** – iamdave
@iamdave在我看来,这是一个糟糕的查询 – dude