接上篇:https://developer.aliyun.com/article/1621741?spm=a2c6h.13148508.setting.14.49764f0eO8xDpK
部分字段查询
这与我们平常写SQL基本是一样的:
select ename, sal, comm from emp; • 1
函数查询
select sum(sal) from emp; select max(sal) from emp; select min(sal) from emp; select avg(sal) from emp;
限制条数
select * from emp limit 3;
WHERE
select * from emp where sal > 2000;
逻辑运算
select null=null; select null==null; select null<=>null; select * from emp where comm is null; select * from emp where deptno in (20, 30);
GROUP BY
select deptno, avg(sal) from emp group by deptno; • 1 • 2 • 3
ORDER BY
select * from emp order by deptno; • 1