当前位置: 代码迷 >> Sql Server >> 你,问个有关问题!
  详细解决方案

你,问个有关问题!

热度:132   发布时间:2016-04-27 14:05:30.0
在线等你,问个问题!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



SQL code
姓名     年龄   金额张小姐    20    121李小姐    25    254陈小姐    30    365



统计年龄小于等于25岁以下的,金额




------解决方案--------------------
SQL code
USE tempdbcreate table mytest(    [name] nvarchar(10),    age int,    price numeric(12))insert into mytest([name],age,price) values ('张小姐','20','121')insert into mytest([name],age,price) values ('李小姐','25','254')insert into mytest([name],age,price) values ('陈小姐','30','365')select * from mytest where age <=25SELECT sum(price) as valprice from mytest where age <=25/*375*/
  相关解决方案