explain
select oi.* from order_invoice oi
where
oi.id in(
select distinct iro.invoice_id from invoice_re_order iro,order_total ot where iro.total_code=ot.total_code and ot.user_id=74
);

 

 


explain
select oi.* from order_invoice oi
where
oi.id in(
select iro.invoice_id from invoice_re_order iro
inner join order_total ot on iro.total_code=ot.total_code and ot.user_id=74
);

 

 


explain
select distinct oi.* from order_invoice oi
inner join invoice_re_order iro on oi.id=iro.invoice_id and iro.total_code in (
select ot.total_code from order_total ot where ot.user_id=74
)
;

 

 


explain
select DISTINCT oi.* from order_invoice oi
inner join invoice_re_order iro on oi.id=iro.invoice_id
inner join order_total ot on iro.total_code=ot.total_code and ot.user_id=74