1、 请查出AUTHORS表中所有在城市OAKLAND的人的所有记录。2、 查找出AUTHORS表中每个STATE中ZIP的最大值。3、 请统计出SALES表中QTY的总数,并以“总量”为标题显示该数据。4、 请将TITLES表中的BUSINESS的所有PRICE求平均值。5、 查找出AUTHORS表中STATE不是CA的CITY。原语句:1、SELECT *, city AS Expr1 FROM authors WHERE (city = 'OAKLAND')2、SELECT COUNT(*) AS Expr1, state, MAX(zip) AS 最大值 FROM authors GROUP BY state3、SELECT COUNT(*) AS Expr1, SUM(qty) AS 总量 FROM sales4、SELECT COUNT(*) AS Expr1, AVG(price) AS 平均值 FROM titles WHERE (type = 'BUSINESS')5、select city,state AS expr1 from authors where (NOT (state IN ('CA')))可不可以改成这样的语句:1、SELECT *, city FROM authors WHERE (city = 'OAKLAND')2、 SELECT state, MAX(zip) AS 最大值 FROM authors GROUP BY state3、 SELECT COUNT(*), SUM(qty) AS 总量 FROM sales4、 SELECT COUNT(*), AVG(price) AS 平均值 FROM titles WHERE (type = 'BUSINESS')5、 SELECT city FROM authors WHERE (NOT (state IN ('CA')))前面一个是原语句,后面是朋友帮我改的语句,我想请教各位高手,能不能将“AS Expr1”去掉,或者干脆将后面朋友写的语句中的“COUNT(*), ”去掉,请高手将最好最正确的语句写给我,谢谢!20号之前要答案。多谢了!我是初学者,搞不清楚什么时候要用“AS Expr1”以及不知什么时候要用到“COUNT(*), ”请顺便帮我解答一下用法,多谢了。
- 2 回答
- 0 关注
- 515 浏览
添加回答
举报
0/150
提交
取消