SELECT
storefronts.*
FROM
cscart_storefronts AS storefronts
LEFT JOIN cscart_storefronts_currencies AS currencies ON storefronts.storefront_id = currencies.storefront_id
WHERE
1 = 1
AND (
currencies.currency_id IN ('3')
)
GROUP BY
storefronts.storefront_id
ORDER BY
storefronts.is_default desc