SELECT prod_id, prod_price, prod_name FROM products WHERE vend_id = 1003 AND prod_price <= 10; SELECT prod_id, prod_price, prod_name FROM products WHERE vend_id = 1002 OR vend_id = 1003; SELECT prod_id, prod_price, prod_name FROM products WHERE vend_id = 1002 OR vend_id = 1003 AND prod_price >= 10; #优先处理AND操作符 SELECT prod_id, prod_price, prod_name FROM products WHERE (vend_id = 1002 OR vend_id = 1003) AND prod_price >= 10; SELECT prod_name, prod_price FROM products WHERE vend_id IN (1002, 1003) #IN操作符和OR操作符功能相同,但优化选用IN ORDER BY prod_name; SELECT prod_name, prod_price FROM products WHERE vend_id NOT IN (1002, 1003) #使用NOT对IN,BETWEEN和EXISTS ORDER BY prod_name;