which do you think is more efficient?
Note: ID is a variable or parameter
this:
select *,(select count(volume) from details group by vol_id having vol_id = ID) from main where id = ID
or this:
select * from main left join (select count(volume) from details group by vol_id) as vol_dtl on vol_dtl.vol_id = main.id where main.ID = ID
Note: ID is a variable or parameter
this:
select *,(select count(volume) from details group by vol_id having vol_id = ID) from main where id = ID
or this:
select * from main left join (select count(volume) from details group by vol_id) as vol_dtl on vol_dtl.vol_id = main.id where main.ID = ID








