假设A表里含有id,del_flag字段,B表中含有id,a_id,del_flag字段
查询A表,同时关联查询B表中对应的数据,使用:
select * from A a left join B b on a.id=b.a_id where a.del_flag='0' and b.del_flag is null or b.del_flag='0'
假设A表里含有id,del_flag字段,B表中含有id,a_id,del_flag字段
查询A表,同时关联查询B表中对应的数据,使用:
select * from A a left join B b on a.id=b.a_id where a.del_flag='0' and b.del_flag is null or b.del_flag='0'
本文标题:oracle left join关联逻辑删除的数据
本文链接:https://www.haomeiwen.com/subject/amxqdktx.html
网友评论