user583576
user583576

Reputation: 619

SQL SELECT Statement max id

I have a table called apps with id, type, and group_id. The table has multiple group_id with same number. I need to get the max id for each group_id number where type equals 1.

My sql skills are not so good. Any help is greatly appreciated

Upvotes: 0

Views: 374

Answers (1)

dash1e
dash1e

Reputation: 7807

select group_id, max(id) as max_id
from apps
where type = 1
group by group_id

Upvotes: 6

Related Questions