JPMorganChase Interview Question

SQL: query which uses Windows function, group by etc