Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *
- FROM mobilenum
- WHERE
- CAST(SUBSTRING(mobileno FROM -4) AS UNSIGNED) >= 1234
- OR
- CAST(SUBSTRING(mobileno FROM -4) AS UNSIGNED) < 1234
- ORDER BY ABS(search - CAST(SUBSTRING(mobileno FROM -4) AS UNSIGNED)
- -- replace the 1234 with the last 4 digits of your search number, $search
- -- ref: http://stackoverflow.com/questions/30932651
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement