Skip to content

Instantly share code, notes, and snippets.

@ArCiGo
Created May 19, 2019 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArCiGo/4e0559135306e71a7c13b559057c5a27 to your computer and use it in GitHub Desktop.
Save ArCiGo/4e0559135306e71a7c13b559057c5a27 to your computer and use it in GitHub Desktop.
SELECT ISNULL(CONVERT(VARCHAR(MAX), ord.OrderDate), 'Sin Fecha')
FROM [ORDER] ord;
GO
/** Output **/
--------------------
Jul 4 2012 12:00AM
Jul 5 2012 12:00AM
Jul 8 2012 12:00AM
Jul 8 2012 12:00AM
Jul 9 2012 12:00AM
Jul 10 2012 12:00AM
Jul 11 2012 12:00AM
Jul 12 2012 12:00AM
...
SELECT NULLIF(100, 50*2);
GO
/** Output **/
----
NULL
SELECT NULLIF(2*2, 2*7);
GO
/** Output **/
-----------
4
SELECT COALESCE(sup.Phone, sup.Fax) "Contacto"
FROM Supplier sup;
GO
/** Output **/
Contacto
------------------------------
(171) 555-2222
(100) 555-4822
(313) 555-5735
(03) 3555-5011
(98) 598 76 54
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment