SQL Abfrage für Oracle 9i

Prediger

Grünschnabel
4.Welches Buch (Autor, Titel, Preis) in der Bibliothek hat den höchsten Preis?

select autor, titel

from katalog k, buchhandel b

where b.isbn=k.isbn

group by autor, titel

.............

Kann mir jemand die SQL Abfrage fertig schreiben
Mein Problem liegt beim Preis


Christian
 
Hallo!

Schau mal hier:

Code:
SQL> create table books(id int, author varchar(32), title varchar(32), price number(38,2));

Tabelle wurde angelegt.

SQL> insert into books values (1,'Nootz/Morick', 'C/C++ Referenz',49.99);

1 Zeile wurde erstellt.

SQL> insert into books values (2,'Robert Simmons, Jr.', 'Hardcore Java',69.99);

1 Zeile wurde erstellt.

SQL> insert into books values (3,'StefanDenninger/Ingo Peters', 'EJB 2.0',39.99);

1 Zeile wurde erstellt.

SQL> select * from (select author, title,price from books order by price desc) where rownum = 1;

AUTHOR                           TITLE                                 PRICE
-------------------------------- -------------------------------- ----------
Robert Simmons, Jr.              Hardcore Java                         69,99

SQL> select author, title, price from books where price = (select max(price) from books);

AUTHOR                           TITLE                                 PRICE
-------------------------------- -------------------------------- ----------
Robert Simmons, Jr.              Hardcore Java                         69,99

...

Gruß Tom
 
Zurück