求一sql

gxq323 2009-07-30 11:00:37
表a
userid username info
1 n1 xx
2 n2 xxx
3 n3 xxx
表b
userid goodsid id
1 1 1
1 2 2
2 1 3
2 2 4
3 1 5
3 2 6
表c
goodsid goods price
1 g1 100
2 g2 200

要求显示
username info sum(price)
我只实现了username 和sum(price) ,info一加上去就提示,分组错误还是什么,帮帮忙了
...全文
61 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
MR丶CHAN 2009-07-30
  • 打赏
  • 举报
回复
select a.username,a.info,sum(c.price) from 表a a,表b b,表c c where a.userid=b.userid and b.goodsid=c.goodsid group by a.username,a.info
gxq323 2009-07-30
  • 打赏
  • 举报
回复
数据库是access

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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