--语法:select * from 表名 *表示查询所有字段数据 select * from Class select * from Student select * from RankingList --常量列 select 1,2,3 --计算列 select '班级:'+Name from Class select Name,数字=1,Id%2 from Class where Id%2=0 --别名 1.别名=值 2.值 as 别名 3. 值 别名 select 班级名称=Name f…
--exists 结合 if else 以及 where 条件来使用判断是否有数据满足条件 select * from Class where Name like '%[1-3]班' if (not exists(select * from Class where len(Name)>=5)) select '满足条件' else select '不满足条件' --in not in 用来做范围判断 select * from Student where ClassId in(select Id…