Cy on Nostr: And of course I find a genuine sqlite bug... sqlite> select distinct author,updated ...
And of course I find a genuine sqlite bug...
sqlite> select distinct author,updated from posts order by updated * 1 DESC limit 5;
posts.author posts.updated
------------ -------------
2405 1734121533
30 1734116621
34 1734114553
36 1734113942
2408 1734112461
sqlite> select distinct author from posts order by updated * 1 DESC limit 5;
2408
2407
2406
2405
2356
sqlite> select distinct author from posts order by updated DESC limit 5;
2409
2405
30
34
36
I guess ORDER BY just... doesn't order by when you're using distinct? Why would *1 totall change it to order by author and not updated? If it was sorting by alphabetical order that still wouldn't change anything, since all the values of "updated" are the same order numerically and alphabetically.
#sqlite #FuckEverything
sqlite> select distinct author,updated from posts order by updated * 1 DESC limit 5;
posts.author posts.updated
------------ -------------
2405 1734121533
30 1734116621
34 1734114553
36 1734113942
2408 1734112461
sqlite> select distinct author from posts order by updated * 1 DESC limit 5;
2408
2407
2406
2405
2356
sqlite> select distinct author from posts order by updated DESC limit 5;
2409
2405
30
34
36
I guess ORDER BY just... doesn't order by when you're using distinct? Why would *1 totall change it to order by author and not updated? If it was sorting by alphabetical order that still wouldn't change anything, since all the values of "updated" are the same order numerically and alphabetically.
#sqlite #FuckEverything