标签:使用 sp 数据 bs ef as nbsp sql class
select AVG(age) as 年龄 from xuesheng
select AVG(chinese) as 语文 from xuesheng where class = 1
*只能对数字类型的进行操作
select COUNT(*) from xuesheng/*查询表中有多少条数据*/
select COUNT(*) from xuesheng where name like ‘王%‘
select COUNT(distinct class) from xuesheng
(两个班级)
select MAX(chinese) from xuesheng where class = 1
select MIN(chinese) from xuesheng where class = 1
select SUM(chinese) from xuesheng
(以上函数括号中都可以加distinct,默认为all)
select AVG(age) as 平均年龄,COUNT(*)as 人数 from xuesheng where class = 1
标签:使用 sp 数据 bs ef as nbsp sql class
原文地址:http://www.cnblogs.com/wleaves/p/4164973.html