How to select and show all the tickets from last calendar year? It seems SQL calls varies a lot, and cannot find how to do this in Firebird, where SQL dialect is 3.

There's a table called TICKETS. This table has INSERT_TIME which is TIMESTAMP. How do I select all the tickets which has insert time year = 2016?
Depending on your needs, you can use:


Using extract:

select *
from tickets
where extract(year from insert_time) = 2016

Using between:

select *
from tickets
where insert_time between timestamp'2016-01-01 00:00:00.0' and timestamp'2016-12-31 23:59:59.99999'



Depending on the volume of data, and the presence of an index on insert_time or not, the second may be preferable over the first.