Created
June 24, 2024 12:27
-
-
Save masterofthesith/ce1e9b9c21d144f2a550a77744e1e31d to your computer and use it in GitHub Desktop.
Mysql'de arama yaparken birebir eşleşen sonucun en önde gelmesi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Birebir eşleşenin en önde gelmesi | |
select * from tablo where field LIKE '%query%' order by (field = 'query'), length(field) | |
#Eşleşme sırasına göre birebir eşleşenden daha aza doğru sonuçların gelmesi | |
select * from tablo where field LIKE '%query%' order by (field like 'query%'), length(field) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment