【发布时间】:2019-03-01 05:12:01
【问题描述】:
我尝试使用连接条件从另一个表更新一个表中的列。我尝试了所有可能的方法,但它显示的 SQL 命令没有正确结束。我正在 sql server 中尝试它。
update a
set a.col4=b.col4
from dummy_jd a
join --select * from dummy_jd a,
(select col1,col2,col3,col4,col5,sum(reported_amount) reported_amount
from dummy_jd_2
where col5=3843
and col3='abc'
and col1=4
and col2=3002
group by col1,col2,col3,col4,col5
) b on (a.col2=b.col5 and a.col4=b.col3)
where a.col1=9;
这是我试过的
【问题讨论】:
-
update a set a.col4=b.col4 from dummy_jd a join --select * from dummy_jd a, (select col1,col2,col3,col4,col5,sum(reported_amount)reported_amount from dummy_jd_2 where col5=3843 and col3='abc' and col1=4 and col2=3002 group by col1,col2,col3,col4,col5)b on (a.col2=b.col5 and a.col4=b.col3) where a .col1=9;这是我试过的......
-
您使用的是什么版本的 SQL(例如 MySQL、Oracle、SQL Server)? “SQL”只是一种语言,不是实际产品。
-
亲爱的蒂姆,我不太了解这可能是 sql server 或 oracle
-
你需要找出这个,否则这个网站上没有人能帮助你。
-
你能帮我怎么找到
标签: sql-server join sql-update