[MySQL] Cara Melakukan Pencarian Like IN atau Multi Like dalam Query

Untuk melakukan pencarian like yang multi umumnya seperti ini:

SELECT * FROM `jobposition` where name like ‘%supervisor%’ or name like ‘%manager%’ or name like ‘%director%’ or name like ‘%partner%’

Ternyata bisa disimple kan dengan :

SELECT * FROM `jobposition` where name REGEXP  ‘supervisor|manager|director||partner’

 

Referensi:

https://stackoverflow.com/questions/4172195/mysql-like-multiple-values

https://forums.mysql.com/read.php?10,392332,392950#msg-392950

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s