大量查询SQL语句 实例
时间:2021-07-01 10:21:17
帮助过:2人阅读
15、自连接(同一张表的链接查询) :select * from `exam` AS a,`exam` AS b,`exam` AS c where a.id=b.id and a.class=‘ 语文‘ and b.class=‘数学‘ and c.class=‘历史‘
16、子查询:
单行子查询 : SELECT ename FROM emp WHERE deptno=(SELECT deptno FROM emp where ename=‘SMITH‘);
多行子查询 : SELECT ename,job,sal,deptno from emp WHERE job IN (SELECT DISTINCT job FROM emp WHERE deptno=10);
大量查询SQL语句 实例
标签: