stefan oros
stefan oros

Reputation: 1

how do i select the dates with a specific month?

How do I select the date with a specific month? For example I have in my table:

1-mar-2015
16-mar-2013
12-feb-2016
14-apr-2014

And I want to get only the dates from march. The result should be:

1-mar-2015
16-mar-2013

Upvotes: 0

Views: 3901

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271003

Databases have ways of extracting date parts. The ANSI standard method is:

where extract(month from date) = 3

Other databases support functions such as month() or to_char() to achieve the same purpose.

Upvotes: 2

Related Questions