1、子查询
--查询年龄比李某 大的学生信息
--sage:年龄
--sid:编号
select * from 表名 where sage>
(
select sage from 表名 where sname='李某'
)
--in:等于 or 在指定值内
select * from 表名 where sid in(1,2,3,5)
--not in:不包括
select * from 表名 where sid not in
2、--创建视图
--score:表名
--Student:表名
--sid、sname、sage、ssex、js、bs 字段名
create view v_TIMI
as
select a.sid,a.sname,a.sage,a.ssex,
b.js,b.bs from Student a
full join score b
on a.sid=b.sid
--使用视图
select * from v_TIMI