📜  sql 存在 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:16.753000             🧑  作者: Mango

代码示例2
Checks for the existence of any record within the subquery, returning true if
one or more records are returned.
Example: Lists any dealerships with a deal finance percentage less than 10.
SELECT dealership_name
FROM dealerships
WHERE EXISTS (SELECT deal_name FROM deals WHERE
dealership_id = deals.dealership_id AND finance_
percentage < 10);