Posted By

arunpjohny on 09/05/07


Tagged

postgres


Versions (?)

Date Parts


 / Published in: SQL
 

  1. /*
  2. * Getting day from a given date
  3. */
  4. SELECT EXTRACT(Day FROM TIMESTAMP '2000-12-16 12:21:13')
  5.  
  6. SELECT EXTRACT(Day FROM TIMESTAMP '2000-12-16 12:21:13') WHERE EXTRACT(Day FROM TIMESTAMP '2000-12-16 12:21:13') > 10;
  7.  
  8. SELECT EXTRACT(Day FROM joindate) FROM employee

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: arunpjohny on September 5, 2007

Valid extract values are

microseconds milliseconds second minute hour day week month quarter year decade century millennium

You need to login to post a comment.