问一个SQL语句

zjy1985cool 2008-12-29 04:12:49
select class_download.classID,
(select classtypeID from class where classID=class_download.classID)as classType,
count(class_download.classID) as countNum,
(select classTitle from class where classID=class_download.classID)as classTitle from class_download
group by class_download.classID order by countNum desc
我要做成这样的
select class_download.classID,
(select classtypeID from class where classID=class_download.classID)as classType,
count(class_download.classID) as countNum,
(select classTitle from class where classID=class_download.classID)as classTitle from class_download
where classType='提交内容'/******提交的内容*****/
group by class_download.classID order by countNum desc
但是加那个就错了哪个朋友帮我改一下谢谢了
...全文
61 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjy1985cool 2008-12-30
  • 打赏
  • 举报
回复
SORRY我看错了 真不好意思
lizhengnan 2008-12-29
  • 打赏
  • 举报
回复
very good 只得0分,呵呵
zjy1985cool 2008-12-29
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 lizhengnan 的回复:]
这种写法,真是.....


SQL code
select cls_d.classID,
cls.classtypeID AS classType,
cls.classTitle AS classTitle,
count(cls_d.classID) as countNum
from class_download cls_d
left outer join class cls
on cls.classID=cls_d.classID
where cls.classtypeID='提交内容'/******提交的内容*****/
group by cls_d.classID,cls.classtypeID,cls.class…
[/Quote]
very Good
wuyq11 2008-12-29
  • 打赏
  • 举报
回复
select class_download.classID,
c.classType,
count(class_download.classID) as countNum,
(select classTitle from class where classID=class_download.classID)as classTitle from class_download left class c on c.classtypeIDclassID=class_download.classID
where classType='提交内容'
group by class_download.classID order by countNum desc
lizhengnan 2008-12-29
  • 打赏
  • 举报
回复
这种写法,真是.....


select cls_d.classID,
cls.classtypeID AS classType,
cls.classTitle AS classTitle,
count(cls_d.classID) as countNum
from class_download cls_d
left outer join class cls
on cls.classID=cls_d.classID
where cls.classtypeID='提交内容'/******提交的内容*****/
group by cls_d.classID,cls.classtypeID,cls.classTitle order by countNum desc

gtiroy 2008-12-29
  • 打赏
  • 举报
回复
学习~
chinawes 2008-12-29
  • 打赏
  • 举报
回复
where classType='提交内容'
改成 where classtypeID = '提交内容' 试试

62,268

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧