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