Aqui busco si elid o id valen 3.
Código PHP:
mysql_query("SELECT tabla1.*,tabla2.name FROM tabla1 INNER JOIN tabla2 ON tabla1.elid = tabla2.id WHERE (tabla1.elid = 3 OR tabla1.id=3) ");
Código PHP:
mysql_query("SELECT *, CASE id WHEN '3' THEN 'NUEVO VALOR' END AS id FROM tabla1 WHERE (elid = 3 OR id=3) ");
mysql_query("SELECT *, if(id=3,NUEVO VALOR,VALOR DEFAULT) as id FROM tabla1 WHERE (elid = 3 OR id=3) ");
Código PHP:
mysql_query("SELECT tabla1.*,tabla2.name if(tabla.id=3,NUEVO VALOR,VALOR DEFAULT) as tabla.id
FROM tabla1 INNER JOIN tabla2 ON tabla1.elid = tabla2.id WHERE (tabla1.elid = 3 OR tabla1.id=3) ");