Re: Non-normalized Join Problem

From: John L Dunn <misioror_at_GAS.UUG.Arizona.EDU>
Date: 1996/03/28
Message-ID: <Pine.SOL.3.91.960328110446.9622A-100000_at_argon.GAS.UUG.Arizona.EDU>#1/1


First off, many thanks to those of you who have responded. I realized that after I submitted by question that I'd phrased it incorrectly.

As some of you have pointed out, I was wrong. My question of

> >
> > How do I define a join so I can run a query asking the question "show me
> > all invoices that have had (Dx1 = Hypertension or Dx2 = Hypertension or
> > Dx3 = Hypertension)"?

using my original join stategy

> > If I use "Where invoice.dx1 = diagnosis.record# or invoice.dx2 =
> > diagnosis.record# or invoice.dx3 = diagnosis.record#"

works fine for the query I proposed. It doesn't pick up just the first matching record as I originally said...

What it doesn't solve is how to display a record showing all three diagnosis on the same line, i.e., given the following,

> > Invoice Table Diagnosis Table
> > ----------------------------- -------------------------------
> > Inv# Dx1 Dx2 Dx3 Record# Diagnosis
> > 123 1 2 1 Influenza
> > 234 2 3 4 2 Bad Karma
> > 345 3 1 3 Hypertension
> > etc etc
> >

display:

Inv#	Dx1		Dx2		Dx3
123	Influenza	Bad Karma	
234	Bad Karma	Hypertension	Diagnosis #4
345	Hypertension	Influenza

THIS is the real problem.

I haven't gotten around to trying out some of the solutions you all have proposed...but will this weekend. If this changes any of your strategies I'd love to hear about it.

Thanks again,

John Received on Thu Mar 28 1996 - 00:00:00 CET

Original text of this message