So I have a table that looks like this:
field_value field_label record_id data_element data_id
8-7-1966 8 immunization 163
8-7-1966 1966-8-7 163 immunizDate 164
163 immunizProvider 165
I need to grab all three of these records, dynamically. I can get the first record by doing:
SELECT
field_value, field_label, record_id, data_element, data_id
FROM
substance_data
WHERE
record_id = 8
But I need to somehow grab the other two records, knowing that that their record_id will equal the data_id of the first record.
1 Answer