where写布尔表达式的注意事项
-
找出与“Smith”居住在同一城市、同一街道的所有客户的名字。
--正确 SELECT customer_name FROM customer WHERE Customer_street IN ( SELECT Customer_street FROM customer WHERE Customer_name = 'Smith' ) AND Customer_city IN ( SELECT Customer_city FROM customer WHERE Customer_name = 'Smith' ); --错误 where后并列查询不可以直接用逗号表示,用and Select customer_name from customer where Customer_street, Customer_city in ( select Customer_street, Customer_city from customer where Customer_name=’ Smith’ );