select count(*) from customer_infowhere custcd not in (select custcd from grade_model_info where custcd = '10000')在這條Sql語句中grade_model_info這張表中事實上是沒有custcd這個字段的,但是這個sql語句不會報錯。會正常執行。但是把select custcd from grade_model_info where custcd = '10000'單獨執行的話會報錯。還有一點就是custcd = '10000'這個限定條件中的值如果在customer_info表中存在記錄,查詢結果會有影響
2 回答

手掌心
TA貢獻1942條經驗 獲得超3個贊
整條語句 執行的話 “select custcd from grade_model_info where custcd = '10000'” 它 只是作為 “select count(*) from customer_info” 的條件存在 只會返回結果 為false或者空 所以 查詢 不受影響 !
- 2 回答
- 0 關注
- 679 瀏覽
添加回答
舉報
0/150
提交
取消