ceu-notes/1/GBD/notes/tema4-ej16.sql

24 lines
616 B
MySQL
Raw Normal View History

2022-02-02 16:27:29 +00:00
-- 1
SELECT TO_NUMBER("1000.45", "9999.99") FROM DUAL;
-- 2
SELECT TO_NUMBER("1000.45€", "9999.99L") FROM DUAL;
-- 3
SELECT TO_NUMBER("-$1000.45", "S$9999.99") FROM DUAL;
-- 4
SELECT TO_CHAR(SYSDATE, "DD/MM/YYYY") FROM DUAL;
SELECT TO_CHAR(SYSDATE, "DD/MM/YY") FROM DUAL;
SELECT LOWER(TO_CHAR(SYSDATE, "DD-MON-YYYY")) FROM DUAL;
SELECT TO_CHAR(SYSDATE, "DD") || " de " ||
trim(LOWER(TO_CHAR(SYSDATE, "MONTH"))) || " de " ||
TO_CHAR(SYSDATE, "YYYY")
FROM DUAL;
-- 5
SELECT TO_NUMBER(SUBSTR(id, 2, LENGTH(id))) FROM FUTBOLISTAS;
-- 6
SELECT TO_CHAR(FECHA_NACIMIENTO, "YYYY") FROM FUTBOLISTAS ORDER BY 1 ASC;