MySQL连表操作_MySQL
程序员文章站
2022-05-20 15:52:09
...
1、自连接
select * from product where vender_id = (select verder_id from product where name='Dove')
select p1.* from product p1, product p2 where p1.id = p2.id and p2.name = 'Dove'
2、根据同表字段更新
update product p1,product p2 set p1.photo_status = 2
where p1.id = p2.id and p2.photo_status is null
3、连接要有条件,否则将出现笛卡尔积
上一篇: 手机连路由,怎样访问同路由的win下apache?
下一篇: 一本关于php基础详解的书。该怎么解决