SQL Plus - 别名类型问题
我需要找到每本书的图书代码和书名,其价格大于每本类型为“HOR”的图书的图书价格。我的桌子看起来像这样,
CREATE TABLE BOOK (
BOOK_CODE CHAR(4) CONSTRAINT BOOK_BOOK_CODE_PK PRIMARY KEY,
TITLE VARCHAR2(40) CONSTRAINT BOOK_TITLE_NN NOT NULL,
PUBLISHER_CODE CHAR(2) CONSTRAINT BOOK_PUBLISHER_CODE_FK REFERENCES PUBLISHER(PUBLISHER_CODE),
TYPE CHAR(3), (this is where the 'HOR' is located)
PRICE NUMBER(4,2),
PAPERBACK CHAR(1)
);
我尝试了几种不同的方法,但我不知所措。我假设我必须使用别名?
I need to find the book code and book title for each book whose price is greater than the book price for every book that has the type 'HOR'. My table looks like this
CREATE TABLE BOOK (
BOOK_CODE CHAR(4) CONSTRAINT BOOK_BOOK_CODE_PK PRIMARY KEY,
TITLE VARCHAR2(40) CONSTRAINT BOOK_TITLE_NN NOT NULL,
PUBLISHER_CODE CHAR(2) CONSTRAINT BOOK_PUBLISHER_CODE_FK REFERENCES PUBLISHER(PUBLISHER_CODE),
TYPE CHAR(3), (this is where the 'HOR' is located)
PRICE NUMBER(4,2),
PAPERBACK CHAR(1)
);
I have tried several different ways but I am at a loss. I am assuming I will have to use an alias?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
未必。您可以像这样使用嵌套 SELECT:
Not necessarily. You could use a nested SELECT like this:
可能吗?
Possibly?