• boehnc (9/17/2012)


    I have one table "patients"...one row per patient.

    Patient.ID, Patient.Name, Patient.address, Patient.gender

    1/Jim/123 elm/M

    I have another table of patient diagnosis codes. It can have multiple dx codes per patient.

    dx.patientid/dx.dxcode/dx.dxcodedesc

    1/23/diabetes

    1/35/chf

    2/33/pnem

    2/34/stroke

    2/56/headache

    I need to bring back in a table unique patients where dxcode = 23 or 34.

    one patient can have 23 and 34..I just need to bring back whether they had one or the other. If I do a left outer join, a patient with 23 and 34 will bring back two entries. How do I have it bring back just one unique entry? Thanks

    Left outer join !!

    Can you please post your query with expected output.

    --rhythmk
    ------------------------------------------------------------------
    To post your question use below link

    https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
    🙂