Sqlserver 查询小技巧
发布时间:2020-12-12 14:08:36 所属栏目:MsSql教程 来源:网络整理
导读:--给列改名 方法1. select sName as '姓名',sAge as '年龄' from student 方法2. select sName '姓名',sAge '年龄' from student 方法3. select '姓名'=sName,'年龄'=sAge from student --Top Distinct select top 2 sName,sAge,sSex from student order by
--给列改名 --Top Distinct --百分之10个学生?? 如果有小数位数,直接进1 select distinct * from student select distinct sName from student select distinct sName,sSex,sAge from student?? --distinct只有当所有的列都重复时,才会剔除 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |