'How to fetch all records based on year in Amazon QLDB

I have a requirement to fetch all records from an amazon QLDB based on the given year.

Here is my data inside the Revenues Table.

{
  ownerId: "u102john2021",
  transactionId: "tran010101010101",
  timeStamp: 2021-06-11T19:31:31.000Z
}
{
   ownerId: "u102john2021",
      transactionId: "tran010101010101",
      timeStamp: 2020-06-11T19:31:31.000Z
    }

If I pass the year 2020 I want to select relevant records.

How can I write a select query on this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source