自定义存储过程 “usp_Helloworld”并使用。实现输出hello world!
create proc usp_Helloworld
as
begin
print 'hello world'
end
exec usp_Helloworld
select sName,sAge,
english=case
when english is null then '缺考'
else CONVERT(nvarchar(6),english)
end,
math=case
when math is null then '缺考'
else CONVERT(nvarchar(6),math)
end,
是否报考=case
when scoreId is null then '未报考'
else '已报考'
end,
是否合格=case
when english>60 and math>60 then '合格'
else '不合格'
end
from Student
left outer join Score on Student.sId=Score.studentId