When using MySQL SELECT can you change the value of a returned field based on other fields?
For example, if I have this select:
SELECT city,state,cou
Update(misprints corrected):
SELECT city,state, CASE WHEN (city IS NULL OR city='') AND (state IS NULL or state='') THEN '' ELSE country END as country_1 FROM `table`
You can also use IF instead of CASE: IF ((city IS NULL OR city='') AND (state IS NULL or state=''),'',country) as country_1
IF
CASE
IF ((city IS NULL OR city='') AND (state IS NULL or state=''),'',country) as country_1