本文介绍了如何只记录单个选择或何处条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好, i对单个SQL查询有点困惑。 表 NoBill活动 0 xyz 0 xyz 1 取消 1 ABC 1 取消 i想删除哪一行不包含账号= 1且活动= ABC i想要重新编号这样 NoBill活动 0 xyz 0 xyz 1 取消 1 已取消 i也写了查询并得到了我想要的相同记录 SELECT * FROM CountySOAPNot e WHERE NoBill = 1 UNION ALL SELECT * FROM CountySOAPNote WHERE NoBill = 0 AND 活动 LIKE ' %cancelled%' i想要onle单选语句。 请帮帮我。 谢谢&注意 Shambhoo 解决方案 只是一个快速修复: SELECT * FROM CountySOAPNote WHERE NoBill = 0 OR (NoBill = 1 AND 活动 LIKE ' %cancelled%') 另一个快速解决方案 SELECT * FROM TABLE WHERE NOT (NOBILL = 1 AND ACTIVITY = ' ABC') Hi all,i am little bit confused about a single sql query.TableNoBill Activity0 xyz0 xyz1 Cancelled1 ABC1 Cancelledi want to remove row which one contains no bill=1 and Activity = ABC i want recoed like thisNoBill Activity0 xyz0 xyz1 Cancelled1 Cancelledi have also write query and getting same record which i wantSELECT * FROM CountySOAPNote WHERE NoBill=1UNION ALLSELECT * FROM CountySOAPNote WHERE NoBill=0 AND Activity LIKE '%cancelled%'i want onle single select statement.please help me.Thanks & RegardShambhoo 解决方案 just a quick fix:SELECT * FROM CountySOAPNote WHERE NoBill=0 OR ( NoBill=1 AND Activity LIKE '%cancelled%' )Another quick fixSELECT *FROM TABLEWHERE NOT (NOBILL = 1 AND ACTIVITY = 'ABC') 这篇关于如何只记录单个选择或何处条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-26 20:50