jgetner wrote:SQL can't do if and else if statements
Oi, says who??
SELECT IFNULL(municipality, IFNULL(zone, region)) AS munizongion, ...
This will, of course, give you the value you desire (in a nifty column alias, if you ask me 🆒) ... though it won't let you determine which value you got. Best you can say is that either the municipality, zone, or region had a value of "foo".
If that suits your application's needs, great! If not, best route is to retrieve all three values and do a bit of processing in PHP.
Also note that I assumed by a column not being "valued", you meant that it had a NULL value (not to be confused with an empty string or anything of that nature).