Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. CREATE TABLE product_review
  2. (`ID` int, `username` varchar(21), `review_title` varchar(30), `reply` int)
  3. ;
  4.  
  5. INSERT INTO product_review
  6. (`ID`, `username`, `review_title`, `reply`)
  7. VALUES
  8. (1, 'Tom', 'Rip-off', 0),
  9. (2, 'Peter', 'Rip-off', 1),
  10. (3, 'May', 'Rip-off', 1),
  11. (4, 'June', 'Rip-off', 1),
  12. (5, 'Tommy', 'Worth the Price', 0),
  13. (6, 'Sammy', 'Worth the Price', 1),
  14. (7, 'Sam', 'Worth the Price',1),
  15. (8, 'Bryan','Worth the Price',1),
  16. (9, 'Sally', 'Average Product', 0)
  17. ;
  18.  
  19. Select `username`,`review_title` from product_review where reply ='0' Limit 3
  20. Select `username`,`review_title` from product_review where reply = '1' and title = 'Rip-off' Limit 2
  21. Select `username`,`review_title` from product_review where reply = '1' and title = 'Worth the Price' Limit 2
  22. Select `username`,`review_title` from product_review where reply = '1' and title = 'Average Product' Limit 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement