dbTalk Databases Forums  

Help with Query

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Help with Query in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
ssanchezz@gmail.com
 
Posts: n/a

Default Re: Help with Query - 12-04-2007 , 05:01 PM






On Nov 25, 9:52 am, "Jeff B" <jef... (AT) KnoSpam (DOT) tds.net> wrote:
Quote:
Hi everyone,

I have a book table and in that table it has the book tile, publisher, and
type of book it is. example mystery, scifi, etc...

I am trying to write a query that brings back a list of every pair of books
that have the same publisher and same book type. I have been able to get
the following code to work:

select publisher_code, type
from book
group by publisher_code, type
having count(*) > 1;

which returns the following results:

PU TYP
-- ---
JP MYS
LB FIC
PE FIC
PL FIC
ST SFI
VB FIC

I can not figure out how to get the book title and book code for the books
that this result list represents, everything i have tried throws out an
error.

Can someone help?

Thanks,

Jeff
cheater


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.