table1:
name | map_id | reg_id
abc | 1 | 5
pqr | 2 | 5
xyz | 3 | 5
table2:
map_id | map_name | is_deleted
1 | map1 | 0
2 | map2 | 0
my sql query :
SELECT *
FROM table1 t1
LEFT JOIN table2 t2
ON t1.map_id = t2.map_id
WHERE t1.reg_id = 5
AND t2.is_deleted = 0
what the above query does is stops me from retrieving record with map_id = 3
in table1.
how can i achieve this as well as 'is_deleted check' if the record exists in table2.
thanks in advance.