I have this query:
Code: Select all
mysql> SELECT ranges.id, ranges_types.type as rtype, ranges.name, gps_n, gps_e
FROM ranges, ranges_types
WHERE ranges.id = '20'
AND ranges.type_id = ranges_types.id
LIMIT 1I would like the query to return rtype as an empty string if there was no matching row in ranges_types table found. I could solve this problem via php and one more SQL query but is there an easier way - to edit the sql query to do what I need?
Thanks in advance