En C++, se puede hacer esto:SQL: Ternario operaciones
T.x = (T.y > 1 && (T.x - T.y < 0)) ? 0 : (T.x - T.y)
que a [casi] llanura Inglés, es
if T.y > 1 and T.x-T.y < 0 then
set T.x to 0
else
set T.x to T.x-T.y
¿Es posible hacer lo mismo usando sólo SQL, sin usar procs o disparadores almacenados?
véase: http: //dev.mysql .com/doc/refman/5.0/es/case-statement.html – diEcho
Ver http: // sta ckoverflow.com/q/1647961/584420 –