Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select b.book_code, b.title, b.price from book b
- inner join book b1 on b.price > b1.price
- where b.type = 'HOR';
- mysql> describe book;
- +----------------+--------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +----------------+--------------+------+-----+---------+-------+
- | BOOK_CODE | char(4) | NO | PRI | NULL | |
- | TITLE | char(40) | YES | | NULL | |
- | PUBLISHER_CODE | char(3) | YES | | NULL | |
- | TYPE | char(3) | YES | | NULL | |
- | PRICE | decimal(4,2) | YES | | NULL | |
- | PAPERBACK | char(1) | YES | | NULL | |
- +----------------+--------------+------+-----+---------+-------+
- 6 rows in set (0.09 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement