Home  • Database • MySQL

MySQL filter with like clause

1. Filter username start with a
SELECT id, email, username, photo FROM users WHERE username LIKE 'a%';
2. Filter username end with a
SELECT id, email, username, photo FROM users WHERE username LIKE '%a';
3. Filter username containing sh
SELECT id, email, username, photo FROM users WHERE username LIKE '%sh%';
4. Filter username exactly matching with jahid
SELECT id, email, username, photo FROM users WHERE username LIKE 'jahid';

Comments 0


Share

Copyright © 2024. Powered by Intellect Software Ltd