mysql - Multiple table search then show null if not found -


i using mysql. have 2 tables:

kecamatan id | name | slug | kota_id 1    kec1   kec1     1 2    kec2   kec2     1   kota id | namek | slugk 1    kot1   kot1 2    kot2   kot2 

i want search in 2 tables 1 query; how result this?

let's search slug containing "kot1"; result be:

id | name | slug | namek | slugk 1     null   null   kot1    kot1 

then when search slug containing "kec2", result be:

 id | name | slug | namek | slugk  1    kec2   kec2   null    null 


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -