I have a table with the following two columns: about
and create_time
.
I want to receive a list of rows that are ordered length(about) DESC
but only per chunk of time. For example:
If I have the following rows:
about | create_time |
---|---|
Hello | 1/1/2023-01-01 00:00:00 |
Hey | 1/5/2023-01-05 00:00:00 |
My name is Daniel | 2/1/2023-02-01 00:00:00 |
Hi | 2/8/2023-02-08 00:00:00 |
HelloWhat's up | 3/4/2023-03-02 00:00:00 |
What's upHello | 3/2/2023-03-04 00:00:00 |
I like to eat | 2023-11/5/2022-05 00:00:00 |
And I want to order them per length of about but only in chunks of last 30 days, I'd expect to get the following:
about | create_time |
---|---|
Hello | 3/4/2023-03-04 00:00:00 |
What's up | 3/2/2023-03-02 00:00:00 |
My name is Daniel | 2/1/2023-02-01 00:00:00 |
Hi | 2/8/2023-02-08 00:00:00 |
Hey | 1/5/2023-01-05 00:00:00 |
Hello | 1/1/2023-01-01 00:00:00 |
I like to eat | 2023-11/5/2022-05 00:00:00 |
So they're ordered by length of about me but per chunk of 30 days, starting from now()
.