Home » SQL & PL/SQL » SQL & PL/SQL » Need help BIG time! even willing to pay a couple bucks for newbie help...
Need help BIG time! even willing to pay a couple bucks for newbie help... [message #353416] Mon, 13 October 2008 15:42 Go to next message
DrBallard
Messages: 20
Registered: October 2008
Junior Member
Hey there, I'm in big trouble now. Assigment to hand in tomorrow and I'm clueless.
I'm using aquadata studio, got a couple tables and I've got to make requests on them, pretty simple right?

First question: For each publisher, I've got to give how many books they've got, the min price, avg price and highest price.

select PUBLISHER_NAME,
count (distinct B.BOOK_CODE) "Nb de Livres",
from HENRY.PUBLISHER P, HENRY.BOOK B, HENRY.INVENTORY I
where P.PUBLISHER_CODE = B.PUBLISHER_CODE
and I.BOOK_CODE = B.BOOK_CODE
group by PUBLISHER_NAME;


I know, I don't even have the min and max price: but the code won't even work. says "Missing expression"

I would looove some help, you can add me on msn : dr_ballard0002 at hotmail

Hopefully someone can help..
Re: Need help BIG time! even willing to pay a couple bucks for newbie help... [message #353417 is a reply to message #353416] Mon, 13 October 2008 15:45 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is missing? The rest of columns behind the comma (which is the last character in the second line).
Re: Need help BIG time! even willing to pay a couple bucks for newbie help... [message #353420 is a reply to message #353417] Mon, 13 October 2008 16:49 Go to previous messageGo to next message
DrBallard
Messages: 20
Registered: October 2008
Junior Member
Thanks a lot... the mistake was that ","!

select distinct AUTHOR_LAST, AUTHOR_FIRST,
count (distinct W.BOOK_CODE)
from HENRY.BOOK B, HENRY.AUTHOR A, HENRY.WROTE W
where A.AUTHOR_NUM = W.AUTHOR_NUM
and B.BOOK_CODE = W.BOOK_CODE;

Now i've got to make a list of books the authors wrote, and say the numbers of publishers they did business with.

I keep getting "not a single group function" thing

[Updated on: Mon, 13 October 2008 23:49] by Moderator

Report message to a moderator

Re: Need help BIG time! even willing to pay a couple bucks for newbie help... [message #353544 is a reply to message #353420] Tue, 14 October 2008 02:43 Go to previous messageGo to next message
amul
Messages: 252
Registered: April 2001
Location: Chennai
Senior Member
You will have to use the Group by clause at the end
Re: Need help BIG time! even willing to pay a couple bucks for newbie help... [message #353575 is a reply to message #353416] Tue, 14 October 2008 04:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter).
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Re: Need help BIG time! even willing to pay a couple bucks for newbie help... [message #353581 is a reply to message #353420] Tue, 14 October 2008 04:28 Go to previous message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
DrBallard
I keep getting "not a single group function" thing

It must be because the query travelled through this thread from post #1 to post #3 and the last line somehow got lost.
Previous Topic: Displaying Seconds as Counter
Next Topic: REF CURSORS using multiple cursors
Goto Forum:
  


Current Time: Tue Dec 06 11:52:44 CST 2016

Total time taken to generate the page: 0.16304 seconds