Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PRODUCT
- id some_column
- 1 10
- 2 2
- 3 8
- COMPARISION
- id product_left product_right result
- 1 1 2 3
- 2 1 3 8
- 3 2 3 2
- SELECT * FROM COMPARISION WHERE ( product_left = 1 OR product_right = 1 ) ORDER BY result DESC LIMIT n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement