Monday, October 21, 2013

Extract Month/Year from dates in Oracle

This is how to extract month or year from Oracle (placing it here so I don't forget)

By Month -
SELECT EXTRACT(month FROM order_date) "Month",
  COUNT(order_date) "No. of Orders"
  FROM orders
  GROUP BY EXTRACT(month FROM order_date)
  ORDER BY "No. of Orders" DESC;

By Year -

For more info, look at this page:

See PDF for more SQL References:


Anonymous said...

Hello! Would you mind if I share your blog with my twitter group?
There's a lot of people that I thinmk would really enjoy your content.
Please let me know. Many thanks

my blog post; apartment in tampa fl ()

Anonymous said...

Good day! I know this is kind of off topic but I was wondering if you knew where
I could locate a captcha plugin for my comment form? I'm using the same blog platform
as yours and I'm having problems finding one? Thanks a lot!

Feel free to visit my page - Cambogia Plus Review (www.netonfree.In)