SHARE
TWEET

Untitled

a guest Dec 16th, 2012 24 Never
  1. TITLE                           PUBDATE                   SYSDATE            AGE                    
  2. BODYBUILD IN 10 MINUTES A DAY  | 21-JAN-01 00:00:00 | 14-NOV-12 13:16:35 | 141  
  3. REVENGE OF MICKEY              | 14-DEC-01 00:00:00 | 14-NOV-12 13:16:35 | 131  
  4. BUILDING A CAR WITH TOOTHPICKS | 18-MAR-02 00:00:00 | 14-NOV-12 13:16:35 | 127    
  5. DATABASE IMPLEMENTATION        | 04-JUN-99 00:00:00 | 14-NOV-12 13:16:35 | 161
  6. COOKING WITH MUSHROOMS         | 28-FEB-00 00:00:00 | 14-NOV-12 13:16:35 | 152
  7. HOLY GRAIL OF ORACLE           | 31-DEC-01 00:00:00 | 14-NOV-12 13:16:35 | 130
  8.  
  9. 14 rows selected
  10.        
  11. SELECT title, TO_CHAR(ROUND(pubdate), 'DD-MON-YY HH24:MM:SS') AS pubdate,
  12.   TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MM:SS') AS "SYSDATE",
  13.   ROUND(SYSDATE - TO_DATE(pubdate)) AS age
  14. FROM books;
  15.        
  16. SELECT title,
  17.        TO_CHAR(ROUND(pubdate), 'DD-MON-YY HH24:MM:SS') AS pubdate,
  18.        TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MM:SS') AS "SYSDATE",
  19.        trunc( months_between( sysdate, pubdate )) AS age
  20.   FROM books;
RAW Paste Data
Top