1、
左联接:select a.*,b.* from tbl1 a left join tbl2 b on a.id=b.id
右联接:select a.*,b.* from tbl1 a right join tbl2 b on a.id=b.id2、select bh,case when bz='rk' then '入库' when bz='ck' then '出库' end as bz,mc from table
左联接:select a.*,b.* from tbl1 a left join tbl2 b on a.id=b.id
右联接:select a.*,b.* from tbl1 a right join tbl2 b on a.id=b.id2、select bh,case when bz='rk' then '入库' when bz='ck' then '出库' end as bz,mc from table
左联接:select a.*,b.* from tbl1 a left join tbl2 b on a.id=b.id where .. order by ..
右联接:select a.*,b.* from tbl1 a right join tbl2 b on a.id=b.id where .. order by ..select bh,case when bz='rk' then '入库' when bz='ck' then '出库' end as bz,mc from table
where .. order by ..