does anyone know how to write this SQL query in a version where window functions are not supported?
SELECT *, ROW_NUMBER() OVER(PARTITION BY tr.ticketId ORDER B