daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT   LEN('Hello') AS [0 trailing spaces],
  2.          LEN('Hello ') AS [1 trailing spaces],
  3.          LEN('Hello  ') AS [2 trailing spaces],
  4.          LEN('Hello   ') AS [3 trailing spaces],
  5.          LEN('Hello    ') AS [4 trailing spaces],
  6.          LEN('Hello          ') AS [10 trailing spaces]
  7. ;
  8.  
  9.  
  10. SELECT   CASE
  11.               WHEN 'Hello' = 'Hello    ' THEN 'EQUAL'
  12.               ELSE 'NOT EQUAL'
  13.          END
  14. ;
  15.      
  16. SELECT   6.0/2.0*3.0,
  17.          6.0/-2.0*3.0
  18. ;
  19.      
  20. SELECT   CAST('' AS INT) AS [INT],
  21.          CAST('' AS BIGINT) AS [BIGINT],
  22.          CAST('' AS FLOAT) AS [FLOAT]
  23. ;
  24.  
  25. SELECT   CAST('' AS DECIMAL(15,6)) AS [DECIMAL],
  26.          CAST('' AS NUMERIC(15,6)) AS [NUMERIC]
  27. ;
  28.      
  29. SELECT   *
  30. FROM     EXAMPLE_TABLE
  31. WHERE    COL1 = 5
  32.          OR COL1 <> 5
  33. ;
  34.  
  35.  
  36. SELECT   *
  37. FROM     EXAMPLE_TABLE
  38. WHERE    COL1 = 5
  39.          OR NOT(COL1 = 5)
  40. ;
  41.      
  42. SELECT   *
  43. FROM     EXAMPLE_TABLE
  44. WHERE    COL1 NOT IN (1, 2, 3, 4, 5, NULL)
  45. ;
  46.  
  47.  
  48.  
  49. SELECT   *
  50. FROM     EXAMPLE_TABLE
  51. WHERE    1 = 1
  52. ;
  53.  
  54.  
  55.  
  56. SELECT   *
  57. FROM     EXAMPLE_TABLE
  58. WHERE    NULL = NULL
  59. ;
  60.      
  61. SELECT   CAST(0.0000006 AS DECIMAL(38,22)) * CAST(1.000000 AS DECIMAL(38,22))
  62. ;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top