Ver Mensaje Individual
  #2  
Antiguo 26-06-2012
Avatar de Chris
[Chris] Chris is offline
Miembro Premium
 
Registrado: abr 2007
Ubicación: Jinotepe, Nicaragua
Posts: 1.678
Reputación: 19
Chris Va por buen camino
COALENCE no es para mejorar el desempeño de la consulta. COALENCE es un operador seguro para evaluar Nulos. Lee: http://www.firebirdsql.org/refdocs/l...-coalesce.html

Entonces, COALENCE podría decirse que funciona así:
COALANCE(Value, Value2, Value3) equivaldrá a:
Código SQL [-]
IF (Value is not NULL) then result := Value
elseif (Value2 is not NULL) then result := Value2
elseif (Value3 is not NULL) then result := value3
...

COALENCE devolverá el primer parámetro que no sea NULL. Recuerda que, a excepción de "IS", no puedes utilizar los operadores para hacer comparaciones con NULL. Ya que el valor de NULL no está definido según el estándar SQL.

Saludos.
__________________
Perfil Github - @chrramirez - Delphi Blog - Blog Web
Responder Con Cita