一个子查询的问题??

risingwolves 2005-02-01 02:22:47
两个表A,B,有uid做为关联
要查出A中每个人在B表中的记录,请问怎么写
select * from A where UID=(select UID,Name from B where UID=??)剩下的不会了
...全文
85 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
risingwolves 2005-02-01
  • 打赏
  • 举报
回复
sql="select realname,max(id),max(score),max(barid),sum(score),sum(kill),sum(killed),max(gameDate),count(realname) from nclass group by realname order by sum(score) desc"

想在两个表里实现这个语句实现的功能!就是计算A表的UID在B表中UID的记录数及各列的总和,SUM和,这样要怎么写
yx360 2005-02-01
  • 打赏
  • 举报
回复
select * from B where id in (select eid from A)
risingwolves 2005-02-01
  • 打赏
  • 举报
回复
不要沉了
risingwolves 2005-02-01
  • 打赏
  • 举报
回复
我想同时算出A表对应B 表中UID的记录数,要怎么写啊
sungcong 2005-02-01
  • 打赏
  • 举报
回复
select a.*,b.* from a join b on a.UID=b.UID
xing_gg 2005-02-01
  • 打赏
  • 举报
回复
内连接OK了
risingwolves 2005-02-01
  • 打赏
  • 举报
回复
select * from A as a,* from B as b where a.UID=b.UID这样行不行啊
friendlyFour 2005-02-01
  • 打赏
  • 举报
回复
select a.*,b.* from a join b on a.UID=b.UID where ...

28,391

社区成员

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

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