Skip to content
Advertisement

MySQL Query WHERE [closed]

[Open this image][1] [1]: https://i.stack.imgur.com/GBQgV.png

I try query, why cant one technition only?

Query :

SELECT a.kode_ticket,a.tanggalbuat_ticket,a.tanggalapprove_ticket,a.tanggalfinish,b.nama_karyawan AS nama_lapor,c.nama_karyawan AS nama_teknisi,a.subject_ticket,a.detail_ticket,a.status_ticket,a.progress_ticket FROM ticket AS a JOIN karyawan AS b ON a.pelapor_ticket=b.nik_karyawan JOIN karyawan AS c ON a.teknisi_ticket=c.nik_karyawan WHERE a.teknisi_ticket = '3603191601000002' AND a.status_ticket = 'Approved' || a.status_ticket = 'Progress'

Like this

kode_ticket|tanggalbuat_ticket|tanggalapprove_ticket|tanggalfinish|nama_lapor|nama_teknisi|subject_ticket|detail_ticket|status_ticket|progress_ticket

0000000|20000000|10000000|5000000|Romauli Naibaho|Muklis 2|blabla|blabla|Progress|20

**SOLVED WITH : WHERE a.teknisi_ticket = ‘3603191601000002’ AND a.status_ticket IN (‘Approved’,’Progress’) **

Advertisement

Answer

Change your WHERE part in the query as below and it should work for you.

WHERE a.teknisi_ticket = '3603191601000002' 
AND a.status_ticket IN ('Approved','Progress')
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement