SELECT
storefronts.*
FROM
tmall_storefronts AS storefronts
WHERE
1 = 1
AND (
storefronts.url = 'backend-dash.tmall.com.tn'
OR storefronts.url = 'www.backend-dash.tmall.com.tn'
OR storefronts.url LIKE 'www_.backend-dash.tmall.com.tn'
OR storefronts.url LIKE 'backend-dash.tmall.com.tn/%'
OR storefronts.url LIKE 'www.backend-dash.tmall.com.tn/%'
OR storefronts.url LIKE 'www_.backend-dash.tmall.com.tn/%'
)
GROUP BY
storefronts.storefront_id
ORDER BY
storefronts.url = 'backend-dash.tmall.com.tn' DESC,
storefronts.url = 'www.backend-dash.tmall.com.tn' DESC,
storefronts.url LIKE 'www_.backend-dash.tmall.com.tn' DESC,
storefronts.url LIKE 'backend-dash.tmall.com.tn/%' DESC,
storefronts.url LIKE 'www.backend-dash.tmall.com.tn/%' DESC,
storefronts.url LIKE 'www_.backend-dash.tmall.com.tn/%' desc