Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE product_review
- (`ID` int, `username` varchar(21), `review_title` varchar(30), `reply` int)
- ;
- INSERT INTO product_review
- (`ID`, `username`, `review_title`, `reply`)
- VALUES
- (1, 'Tom', 'Rip-off', 0),
- (2, 'Peter', 'Rip-off', 1),
- (3, 'May', 'Rip-off', 1),
- (4, 'June', 'Rip-off', 1),
- (5, 'Tommy', 'Worth the Price', 0),
- (6, 'Sammy', 'Worth the Price', 1),
- (7, 'Sam', 'Worth the Price',1),
- (8, 'Bryan','Worth the Price',1),
- (9, 'Sally', 'Average Product', 0)
- ;
- Select `username`,`review_title` from product_review where reply ='0' Limit 3
- Select `username`,`review_title` from product_review where reply = '1' and title = 'Rip-off' Limit 2
- Select `username`,`review_title` from product_review where reply = '1' and title = 'Worth the Price' Limit 2
- 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