[eluser]spyro[/eluser]
Thanks. The query now comes out to be:
SELECT
a.id, a.name, a.billing_address_street, a.billing_address_city, a.billing_address_state, a.billing_address_postalcode, a.billing_address_country, a.website, a.description,
ac.eighthundrednumber_c, ac.mechanixlooprating_c, ac.extension_c, ac.petfriendly_c, ac.womenowned_c, ac.providearide_c,
count(mrc.id_c)
FROM (accounts a)
JOIN accounts_cstm ac ON ac.id_c = a.id
LEFT JOIN mech_reviews_cstm mrc ON mrc.userid_c = a.id AND mrc.inactive_c = 1
WHERE `a`.`billing_address_state` = 'GA' AND `a`.`billing_address_city` = 'Atlanta'
ORDER BY count(mrc.id_c) desc, ac.premiummember_c desc, ac.mechanixlooprating_c desc
LIMIT 6
If I run the select from accounts with the where then I get the correct number of records. If there are no related reviews in the LEFT JOIN would it still send back the account portion just without the review count?