简单子查询

select *from Student
--使用局部变量查询出生日期比张飞的人的信息
declare @Born nvarchar(20) --声明局部变量
select @Born=Birthday from Student where StuName='张飞'
select StuNo,StuName ,Birthday,Address from Student where Birthday>@Born
--子查询
select StuNo,StuName ,Birthday,Address from Student
where Birthday>(select Birthday from Student where StuName='张飞')

posted @   努力奋斗吧  阅读(262)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示