SELECT
storefronts.*
FROM
cscart_storefronts AS storefronts
WHERE
1 = 1
AND (
storefronts.url = 'satish.ecarter.co'
OR storefronts.url = 'www.satish.ecarter.co'
OR storefronts.url LIKE 'www_.satish.ecarter.co'
OR storefronts.url LIKE 'satish.ecarter.co/%'
OR storefronts.url LIKE 'www.satish.ecarter.co/%'
OR storefronts.url LIKE 'www_.satish.ecarter.co/%'
)
GROUP BY
storefronts.storefront_id
ORDER BY
storefronts.url = 'satish.ecarter.co' DESC,
storefronts.url = 'www.satish.ecarter.co' DESC,
storefronts.url LIKE 'www_.satish.ecarter.co' DESC,
storefronts.url LIKE 'satish.ecarter.co/%' DESC,
storefronts.url LIKE 'www.satish.ecarter.co/%' DESC,
storefronts.url LIKE 'www_.satish.ecarter.co/%' desc