Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Help on query
SELECT X.std_no
FROM exam X
,exam Y
WHERE X.std_no = Y.std_no
AND X.subject = 'CHEM' AND X.point = 'A'
AND Y.subject = 'PHYSIC' AND Y.point = 'A'
"Alex B. Cheng" wrote:
> SELECT DISTINCT std_no
> FROM exam
> WHERE POINT IN ('A','B');
>
> At 12:00 AM 5/22/2001 -0800, you wrote:
>
> >Dear gurus,
> >
> >I have a table :
> >Tabel Exam
> >STD_NO SUBJECT POINT
> >====== ======= =====
> >001 CHEM A
> >001 PHYSIC A
> >001 BIOLOGY A
> >
> >002 CHEM A
> >002 PHYSIC B
> >002 BIOLOGY A
> >
> >003 CHEM A
> >003 PHYSIC A
> >003 BIOLOGY B
> >
> >What is the SQL query to retrieve STD_NO which have CHEM = A and PHYSIC = A?
> >
> >The output should be :
> >STD_NO
> >======
> >001
> >003
> >
> >TIA,
> >
> >Ahmadsyah Alghozi Nugroho
> >Database Engineering Specialist
> >PT Infoglobal AutOptima
> >Jl. Baruk Tengah I/49
> >Surabaya - Jawa Timur
> >INDONESIA
> >phone : +62 (31) 8708456 ext.113
> >visit [ORAID!] <http://oraid.iwarp.com>http://oraid.iwarp.com
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Alex B. Cheng
> INET: abc_at_agham.dost.gov.ph
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: priya ramakrishnan INET: priya.ramakrishnan_at_oracle.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue May 22 2001 - 03:43:51 CDT