摘要:
大于30号部门最高工资的所有员工信息(2种写法) select * from emp where sal>all(select sal from emp e2 where deptno=30) select * from emp e where sal>(select max(sal) from e 阅读全文
摘要:
1、--单个主键create table student( id int primary key, name varchar(50)); 2、--联合主键 create table student( id int, classid int, name varchar(50), primary key 阅读全文
摘要:
select sal+ifnull(comn,0) as total from emp 如果comn值为null直接将值替换为0与sal相加,如果不为null就有原值与sal相加 as是相加的加过列名称叫total order by 列名 asc(默认升序) desc降序 查询所有雇员,按月薪降序排 阅读全文