SQL Question

From: Joseph Bonner <jbonner_at_mmg.im.med.umich.edu>
Date: 1998/04/18
Message-ID: <35386B3F.2041EACF_at_mmg.im.med.umich.edu>#1/1


[Quoted] [Quoted] I have a research database with a normalized structure. I need to put the data into a completely denomalized structure for analysis.

[Quoted] I have a table that looks like this

RESP_ID SEX

10001         MALE
10002         FEMALE

[Quoted] one that looks like this....

[Quoted] RESP_ID_FK      SURG_ID      SURG_DATE     SURG_SEQ
10001                   1                    1-jan-1998          1
10001                   2                     1-feb-1998         2
10002                    3                     1-mar-1998       1

[Quoted] And another that looks like this ...

[Quoted] SURG_ID_FK       CAN_ID     TISSUE  can_seq
1                             1                  12           1
1                              2                  13           2
1                              3                  14           3
2                              4                  11           4
2                              5                  10           5
3                              6                   9            1

[Quoted] I need to create a view that looks like this

[Quoted] RESP_ID SEX SUGDAT1 SURGDAT2 TIS1 TIS2 TIS3 TIS4 TIS5

10001         male    1-jan-1998    1-feb-1999    12        13
14       11         10
10002         female 1-mar-1998    NULL           9         NULL  NULL
NULL NULL [Quoted] Does anybody have sugestions?

Thanks in advance
Joe B> Received on Sat Apr 18 1998 - 00:00:00 CEST

Original text of this message