How to retrieve data groups to search the rows of the groups?


The database has columns: id, group_id, data

Need from the table to retrieve the data in the following way:
1) data should be grouped by group_id
2) established the condition where data = 'data132'

In the result, you need to get all groups to which at least one row of the condition 2.
How it can be implemented?
Thank you.
July 4th 19 at 23:10
1 answer
July 4th 19 at 23:12
Select distinct group_id
from MyTable
where data = 'data132'

Find more questions by tags MySQLSQL