select studid,sum(cast(courcredit as decimal(18,0))) from g_grade where exists
(
select studid from e_student where
courid not like '00%' and reupflag = '0' and e_student.studid = g_grade.studid and classname = 'KT543-2'
)
group by studid
(
select studid from e_student where
courid not like '00%' and reupflag = '0' and e_student.studid = g_grade.studid and classname = 'KT543-2'
)
group by studid
解决方案 »
- 急急急急急急急急急急急急急急急急!!!
- 如何合成时间?
- 两条开源的SQL优化。
- 两个表用同一个增长序列做主键,该怎么弄?
- 请教高手
- 请教高手关于sql2005数据转换服务在哪里找啊?
- SQL Server企业版为何导出EXCEL时提示无法初始化链接服务器 "(null)" 的 OLE DB 访问接口 "MICROSOFT.JET.OLEDB.
- SQL 中如何判断字段为NULL 或 为空串
- sql server 2005中 全文索引的 缓存 被清空的情况
- SQL Server安装时 用Setup /t RegistryRebuild = On有何用途?
- 求SQL語句
- 怎么去除某个数据库用户的执行 存储过程 的权限
from e_student m , g_grade n
where m.studid = n.studid and m.courid not like '00%' and reupflag = '0' and m.classname = 'KT543-2'
group by m.studidreupflag是哪个表的?
select A.studid,sum(isnull(Bcourcredit,0)) as courcredit
from e_student A
left join g_grade B
on A.studid=B.studid and B.courid not like '00%' and B.reupflag='0'
where classname='KT543-2'
group by A.studid
select 学号=t0.studid,
学分=sum(isnull(t1.courcredit,0))
from e_student t0
inner join g_grade t1
on t0.studid=t1.studid
where classname='KT543-2'
and t1.courid not like '00%'
and t1.reupflag='0'
group by t1.studid