HELP: SQL SELECT

From: <sl6gs_at_cc.usu.edu>
Date: 1995/10/16
Message-ID: <1995Oct16.122924.63885_at_cc.usu.edu>#1/1


I have a table of patient code, every patient with a card_no(unique) but each card_no with multi DIAG_COD NO, I can not figure out how to find a patient with several DIAG_COD at same time, say I want to use SQL find all the patients with both DIAG_COD 621.100 and 303.500 or with 621.100 and 303.500 and 339.000

sample table as following

SQL> SELECT * FROM PT_CODE
  2 WHERE CARD_NO = '10007'; Card_no WHEN C P DIAG_COD C REP_NO

----- --------- - - --------- - ---------
10007 17-MAR-89 0 T 621.100     A 	0
10007 11-MAR-88 0 T 621.100     B 	0
10007 17-MAR-89 0 T 621.100     B 	0
10007 04-SEP-87 0 T 621.100     A 	0
10007 04-SEP-87 0 T 339.000     B 	0
10007 15-JUL-87 0 T 621.100      C 	0
10007 15-JUL-87 1 T 303.500      C 	0
10007 11-MAR-88 0 T 621.100    A 	0
10007 11-MAR-88 0 T 621.100    B 	0
10007 21-SEP-92 0 T 621.100    A 	0
10007 14-OCT-91 0 T 621.100    A 	0

Any suggestion?

Wei JIang

                    ||||||||
                     | ~  ~ |
                    (| _at_  @ |)
----------------oOOo---(__)---oOOo------------------------
Received on Mon Oct 16 1995 - 00:00:00 CET

Original text of this message