SQL语法中的子查询Subqueries

记一下样子。

明白它的应用场景。

SELECT account_id, product_cd, cust_id, avail_balance
FROM account
WHERE open_emp_id <> (SELECT e.emp_id
FROM employee AS e INNER JOIN branch AS b
ON e.assigned_branch_id = b.brach_id
WHERE e.title = 'Head Teller' AND b.city = 'Woburn');
SELECT branch_id, name, city
FROM branch
WHERE name IN('Headquarters', 'Quincy Branch');
SELECT branch_id, name, city FROM branch WHERE name IN('Headquarters', 'Quincy Branch');

SQL语法中的子查询Subqueries

上一篇:Eclipse 的快捷键以及文档注释、多行注释的快捷键


下一篇:Excel公式错误提示啥意思?