->select($db->quoteName('country_id'))
->from($db->quoteName('#__redshop_country'))
->where($db->quoteName('country_3_code') . ' = ' . $db->quote('USA'));
->select('*')->from($db->quoteName('#__redshop_state'))->where($db->quoteName('country_id')) . ' IN (' . $db->quote(subQuery) . ')');
Sub queries are usually slower than joins so I would join it:
SELECT * FROM `jos_redshop_state`
WHERE `country_id`IN ( SELECT `country_id`FROM `jos_redshop_country` WHERE `country_3_code` = 'USA')
-- You received this message because you are subscribed to the Google Groups "Joomla! General Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com. To post to this group, send email to joomla-de...@googlegroups.com. Visit this group at http://groups.google.com/group/joomla-dev-general. For more options, visit https://groups.google.com/d/optout.