New answers tagged

1 vote
Accepted

Getting all shared values of two or more given values in one table (SQL)

Based on the data and expected result I think you are looking for MySQL HAVING clause. Your data: CREATE TABLE test( uid INT, cid int ); insert into test values (1,1), (2,1),(3,1),(2,2),(3,2); ...
user avatar
  • 1,163

Top 50 recent answers are included