Re: HELP: SQL SELECT

From: Hugh Stewart McKenna <ahipc1j.smcken01_at_eds.com>
Date: 1995/10/20
Message-ID: <468hll$bh3_at_maverick.tad.eds.com>#1/1


sl6gs_at_cc.usu.edu wrote:
>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

If you want to find ONLY the patients with more than one DIAG_COD_NO try

Select Card_no, count(*) from PT_CODE
group by card_no having count(*) > 1;

-- 
Hugh Stewart McKenna    ahipc1j.smcken01_at_eds.com
The above are entirely my own opinions.
Any other opinions are entirely someone else's opinions
 ( unless I change my mind )
Received on Fri Oct 20 1995 - 00:00:00 CET

Original text of this message