mysqlupdatejoin更新_mysql多表join时候update更新数据的⽅
法很⽂博客
如果item表的name字段为''就⽤resource_library 表的resource_name字段前⾯加上字符串Review更新它,他们的关联关系在表
resource_review_link中。
sql语句:
手指类风湿自我疗法update item i,resource_library r,resource_review_link l set i.name=CONCAT('Review:',r.resource_name) where i.item_id=l.instanc
and l.level='item' source_source_id and i.name=''
JOIN UPDATE & JOIN DELETE
excel的基本公式应用update a
set a.schoolname = b.schoolname
from tb_Std as a join tb_Sch as b on a.School = b.School
where a.std_year = 2005
go
/*
(2 row(s) affected)
*/
select *
from tb_Std as a join tb_Sch as b on a.School = b.School
/*
A School A A School
2 2005 A A School A A School
3 200
4 C A School C C School
4 200
5 D D School D D School
(4 row(s) affected)
oracle数据库sys用户密码*/
delete a
from table1 a, table2 b
l1 = b.col1
l2 = b.col2
The above SQL statement runs fine in SQL Server.
If the Oracle 9i has different syntax or if there is any other way to accomplish this with a single delete statement that would
be really helpful.
> Hi,
>
> Is the following delete statement possible in Oracle 9i.
>mysql语句多表查询
> delete a
> from table1 a, table2 b
> l1 = b.col1
> l2 = b.col2
>
> The above SQL statement runs fine in SQL Server.
>
> If the Oracle 9i has different syntax or if there is any other way to accomplish this with a single delete statement that would be really helpful.
>
> Thanx in advance.
>
> -Bheem
bootstrap预测模型Bheem,
Try this:课程之家
DELETE FROM table1 a where exists (select 1 from table2 b
l1 = b.col1 l2 = b.col2);
Hope this helps,
Tom K.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论