SQL query to select distinct record with 2 or more repetition in another field
- by kyohiros
So I have this table of book orders, it contains 2 columns, one is the order ID(primary key) and another is the ID of the book that the customer ordered. For example:
| OrderID | BookID |
| 0001 | B002 |
| 0002 | B005 |
| 0003 | B002 |
| 0004 | B003 |
| 0005 | B005 |
| 0006 | B002 |
| 0007 | B002 |
What I…