sql子查询
子查询
语法:select * from 表名 where 字段1 条件1 (select * from 表名 where 字段2 条件2);
--查询出工资比赵云高的员工信息
SELECT * from people WHERE PeopleSalary>( select peoplesalary from people where PeopleName='赵云');
--查询和赵云再同一个城市的员工信息
select * from people where PeopleAddress=(SELECT PeopleAddress from people where PeopleName='赵云');
浙公网安备 33010602011771号