i have a table called properties, i want to get all records in this table that match “hold=1” but an extra table holds property names in diferent languages i need to get the english language or if doesnt exist the language markes as default
table properties:
pid hold
property_translations:
pid lang_id pname description isDefault
i normally get the language using a union
(select pname from property_translations where lang_id='en' and pid=$pid)
union
(select pname from property_translations where isDefault='Yes' and pid=$pid)
limit 1
1 Answer