SQL View creation: Many rows to one row

Posted by Randy Kight on 29-Jul-2016 10:15

Was hoping someone could assist me with an example of how I might create a sql view, where some columns within that view contain comma delimited values from 1 to many other records within the database...denormalizing many records into one if you will.

Example:

patient_id, policy_number, diagnosis_codes

where the view's diagnosis_codes column would be a distinct list of values found from our patient_policy.diagnosis_code column for all the patient_policy table records for that patient for a particular policy.

If anyone has experience with this, sincerely appreciate the time in response.

All Replies

This thread is closed