Quantcast
Channel: MySQL Forums - Performance
Viewing all articles
Browse latest Browse all 1205

which is faster and more efficient? (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 1205

Latest Images

Trending Articles



Latest Images