Y
Y
YakutD2019-04-14 14:50:56
SQL
YakutD, 2019-04-14 14:50:56

How to find out which employee has the fewest records with one query?

Hello, there is a "requests" table, it stores user requests. Each request is assigned a moderator, in the moderator_id field. The goal is to get the id of the moderator with the least number of entries. To do that I did it, but not with one request. Actually, the question is - how can you get this information in one request.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-04-14
@inoise

Learn in aggregate functions. Sum, group by

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question