您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

分享一个自己写的比较全的SQL语句

2024/6/22 9:51:35发布49次查看
最近要准备复习,考msserver2005,就是相关的sql语句总结了下,一般常用的就没写了,都是一些可能会用到,不经常用,但是也并不是不用的语法,希望对大家有用 sql语句 select disinct(学号),等级= casewhen 总学分50 then '及格'when 总学分80 then '很好'els
最近要准备复习,考msserver2005,就是相关的sql语句总结了下,一般常用的就没写了,都是一些可能会用到,不经常用,但是也并不是不用的语法,希望对大家有用  sql语句 select disinct(学号),等级= case when 总学分>50 then '及格' when 总学分>80 then '很好' else '优秀' end, top(5) [percent] into tb_name_other from tb_name cross join tb_second_name where th_colnum = 'xxxx' and name like '%王#_%' escape '#' and major in ('计算机','软件','通信') and birthday not between 'a' and 'b' and contains(*,'工程') and freetext(*,'作业') group by expression with cube /with rollup having expression order by expression compute count(学号) by 专业 union all select * from tb_third_name where 学号='xxxx' except/intersect select * from tb_forth_name where 性别='1'(不能与compute 子句一起使用)
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product