S
S
Snewer2016-09-19 18:53:51
MySQL
Snewer, 2016-09-19 18:53:51

How to extract data in groups with group row search?

Hello!
The database has columns: id, group_id, data
It is necessary to extract data from the table in the following way:
1) the data must be grouped by group_id
2) the condition where data = 'data132' is set
As a result, you need to get all groups for which at least one line, condition 2 is met.
How can this be implemented?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
igruschkafox, 2016-09-29
@igruschkafox

Select distinct group_id
from MyTable
where data = 'data132'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question