Advertisement
MagnusArias

DB2 | zadania

Mar 19th, 2018
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.63 KB | None | 0 0
  1. --ZADANIE 2
  2.  
  3. SELECT *
  4.   FROM EMPLOYEE
  5.   --WHERE FIRSTNME BETWEEN 'C' AND 'S'
  6.   WHERE SUBSTR(LCASE(FIRSTNME), 1, 1) BETWEEN 'c' AND 's'
  7.     AND SUBSTR(LCASE(FIRSTNME), 3, 1) NOT LIKE 'l'
  8.  
  9.  
  10. -- ZADANIE 6
  11. SELECT CURRENT TIME, CURRENT DATE
  12.   FROM SYSIBM.SYSDUMMY1
  13.  
  14.  
  15. -- ZADANIE 7
  16. SELECT FIRSTNME, LASTNAME, BIRTHDATE
  17.   FROM EMPLOYEE
  18.   WHERE BIRTHDATE BETWEEN (SELECT CURRENT DATE - 50 YEARS
  19.                      FROM SYSIBM.SYSDUMMY1) AND (SELECT CURRENT DATE - 30 YEARS
  20.                                                    FROM SYSIBM.SYSDUMMY1)
  21.  
  22.  
  23.  
  24. db2set DB@_COMPATIBILITY_VECTOR=ORA
  25. db2set DB2_DEFERRED_PREPARE_SEMANTICS=YES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement