SELECT
cscart_store_locations.*,
cscart_store_location_descriptions.*,
cscart_country_descriptions.country as country_title
FROM
cscart_store_locations
LEFT JOIN cscart_country_descriptions ON cscart_store_locations.country = cscart_country_descriptions.code
AND cscart_country_descriptions.lang_code = 'vn'
LEFT JOIN cscart_store_location_descriptions ON cscart_store_locations.store_location_id = cscart_store_location_descriptions.store_location_id
AND cscart_store_location_descriptions.lang_code = 'vn'
LEFT JOIN cscart_companies ON cscart_store_locations.company_id = cscart_companies.company_id
WHERE
1 = 1
AND 1 = 1
AND cscart_store_locations.status = 'A'
AND cscart_store_locations.company_id <> 0
AND cscart_companies.status = 'A'
GROUP BY
cscart_store_locations.store_location_id
ORDER BY
cscart_store_locations.position asc,
cscart_store_location_descriptions.name asc