[英]Teradata SQL - Where clause and conditions depending on conditions
Note- not all columns are listed here in the Master Table for brevity. 注意-为简洁起见,并非所有列都在主表中列出。 Psuedo code of the where clause - where子句的伪代码-
My where clause goes like this (with some selected conditions) - 我的where子句是这样的(在某些选定条件下)-
But this appears to give incorrect answer. 但这似乎给出了错误的答案。 Perhaps something is wrong with the logic. 逻辑上可能有问题。 Please advice. 请指教。
You can try this 你可以试试这个
SELECT *
FROM [MASTER]
WHERE
Ship_country in ('A','B','C','D')
AND
(
(customer_number <> 'A2')
OR
(customer_number <> 'B2')
OR
(customer_number NOT IN ('C1', 'C2'))
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.