我不熟悉SQL。所以,當我們經歷這個時,請和我一起裸照。 我想寫一個SQL查詢從表中排除某些參數。這裏是我的查詢:排除SQL查詢中的內容
SELECT RULE_NAME AS "Rule Name", COUNT(RULE_NAME) AS "Event_cnt"
FROM EVENTS_VW
WITH (NOLOCK)
WHERE RULE_NAME LIKE
('Reporting_%')
AND EVENT_DT >= '2016-12-01 00:00:00.0' AND EVENT_DT <= '2016-12-31 00:00:00.0'
GROUP BY RULE_NAME ORDER BY EVENT_CNT DESC
規則我想在上面的查詢,以排除有:
Reporting_deleted_mail
Reporting_fwd_mail
如何修改上面的查詢,以容納兩個規則我試圖排除請?任何幫助將不勝感激。
'AND RULE_NAME NOT LIKE'Reporting_deleted_mail'' and'AND RULE_NAME NOT LIKE'Reporting_fwd_mail'' – mike510a