Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select question
No, the callnumber and borrowmeno are different. But callnumber is in both
tables.
SELECT
B.BORROWMENO
FROM
BOOK B, AUTHOR A
WHERE
B.callnumber = A.CALLNUMBER
AND A.LNAME = 'Collins';
"John Campbell" <john.campbell7_at_virgin.net> wrote in message
news:HD%k9.1462$XC6.44915_at_newsfep1-win.server.ntli.net...
> Unless there is a relationship between the tables then you cannot do this.
> If there is a relationship I assume it is that the CALLNUMBER in the
AUTHOR
> table is the same as the BORROWMENO in the BOOK table. If this is the case
> then you might try something like this:
>
> SELECT
> B.BORROWMENO
> FROM
> BOOK B, AUTHOR A
> WHERE
> B.BORROWMENO = A.CALLNUMBER
> AND A.LNAME = 'Collins';
>
> "CD - ROM" <冇人知@有人知多金> wrote in message
> news:an1tsg$24f3_at_imsp212.netvigator.com...
> > Dear All
> >
> > I have the follow table:
> >
> > Table 1 : AUTHOR
> >
> > CALLNUMBER FNAME LNAME
> > Call123 Hello Homer
> > Call124 Hello Homer
> > Call125 Jack Collins
> > Call126 Jack Collins
> > Call127 Winston Churchill
> > Call127 John Keegan
> > Call128 Jeff Tanenbaum
> > Call129 Carlos Tanaka
> >
> > Table 2 : BOOK
> >
> > BORROWERMEMNO BORROWDUE CALLNUMBER LIBCHECK
> > 123 12-DEC-00 Call123
> > 202
> > 125 11-NOV-00 Call123
> > 201
> > 124 09-JUN-00 Call124
> > 201
> > 125 11-NOV-00 Call124
> > 201
> > 125 11-NOV-00 Call125
> > 201
> > 125 11-NOV-00 Call126
> > 201
> > 124 09-JUN-00 Call126
> > 202
> > 125 11-NOV-00 Call128
> > 201
> > 126 10-OCT-00 Call128
> > 202
> > 123 12-DEC-00 Call129
> > 202
> > 125 12-DEC-00 Call129
> > 202
> >
> > I want to write a SQL to list the borrowermemno of all the members
> > who have borrowed all titles written by "Collins."
> >
> > Please give me some idea.
> >
> > Thanks for your help!
> >
> > Tony
> >
> >
>
>
Received on Fri Sep 27 2002 - 12:59:57 CDT