Skip to content
Advertisement

Problems with SQL query. Select row with max() column

You need to get the username or usernames with the maximum number of integrations.

ER Diagramsenter image description here

Try One:

Problems if there are several users with the maximum number of integrations.

Try Two (Scripts):

Not optimal

Please help me, sorry for the English.

Advertisement

Answer

I think you just want window functions:

Note: Assuming that there is at least one “integration”, then an outer join is not needed.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement