使用mysql连接两个子查询语法错误

时间:2018-01-17 16:28:55

标签: mysql subquery

我在sql中使用以下代码,它给了我语法错误。任何人都可以帮我找出原因吗?谢谢!

(
select accepter_id, count(*) as accept_cnt
from request_accepted
group by accepter_id) a
left join
(
select requester_id, count(*) as request_cnt
from request_accepted
group by requester_id) b
on a.accepter_id = b.requester_id

1 个答案:

答案 0 :(得分:0)

如果没有request_accepted的定义,这有点难,但这是我的试用版:

df<-mutate(df,addl_col=df2$'col')
df<-df%>%mutate(addl_col=df2$'col')