On Thu, Jul 6, 2023 at 9:02 AM Shaozhong SHI <shishaozhong(at)gmail(dot)com> wrote:
>
> How about
> ID
> 5
> 4
> 3
> 3
> 2
> 3
>
> The last is 3.
>
>
There is no concept of "last" in a query unless you define an order. If
you really want whatever row really happens to randomly show up in the last
result row the use the "row_number()" window function to give each row a
number and then sort and limit on that.
David J.