晚上关节痛吃姜片:select distinct id ,num=sum(cast((num) as int) from sy order by id desc
来源:百度文库 编辑:中科新闻网 时间:2024/05/10 08:12:45
有什么地方错了,指出谢谢!
应该分组查询
select distinct id ,Totalnum=count(num)
from sy group by id order by id desc
如果num不是int可以
select distinct id ,nums=count(cast((num) as int)
from sy group by id order by id desc
sum(cast((num) as int)
int 是保留字。换个名字试试
select distinct id ,num=sum(cast((num) as int) from sy order by id desc
select 之distinct 如何使用
请教数据库查询集 select 中的distinct问题
select * from table1 where id in (select id from table2),
select * from buy where id= 261
select @id=id from [dbo].[table1] where id > -1 order by id ASC
stb="select top 1 id FROM our order by id "
Select min(id) as id,bid from zhan group by bid
sql="select * from exam_subject where id="& cint(id(j))是什么意思?
sql="select * from main where id="&id 这句啥意思