摘要:
use demogoselect * from hanshu --【COUNT(*)】分男女组查询--查询男女各多少人select COUNT(*) FROM hanshu WHERE sex='男' select COUNT(*) FROM hanshu WHERE sex='女' --【一次性查 阅读全文
摘要:
--【1.模糊查询 like 通配符%】--以汤开头后面随便多少位都有可以select name,sex,id from hanshu where name LIKE '汤%'--只要有汤的都会显示出来select name,sex,id from hanshu where name LIKE '% 阅读全文
摘要:
order by DESC 升 order by ASC 降 USE demoGO--对name sex age 列表中的 age 从高到低 --把年龄从高到低顺序显示 SELECT name,sex,age FROM text order by age DESC--把年龄从低到高顺序显示 SELE 阅读全文
摘要:
USE demogoselect * from text --【1】在查询中使用常量列 :方便统计 增加列名年级,统一内容初一select id 用户号, age 年龄,sex 性别,'初一' AS 年级 from text --【2】查询返回限制的行数。使用top关键字--(1)返回限定个数 限定 阅读全文