By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Expression #1 of ORDER BY clause is not in SELECT list, references column 'fiddle.app_transaction.id' which is not in SELECT list; this is incompatible with DISTINCT