I have one table and I need to check if two users for which I have identifiers (for example, 20 and 21) have the same course, only true or false.
Table: jos_gj_users
Columns: id_user, id_group
Data Example: (20; 4)
(20; 5)
(20; 6)
(21; 6)
(21; 7)
The data above shows that user 20 and user 21 are sharing course 6, but how can I get this with SQL by simply entering identifiers and not looping the results with PHP?
source
share