I have 4 tables:
- source
- fields(fields for the source)
- source_data
- source_data_details(child of source_data, containing records saved in row technique)
source
id name status
1 web active
field
id source_id name config status
1 1 record_id 101 active
2 1 firstname 101 active
3 1 surname 101 active
source_data
id source_id status
1 1 active
2 1 active
source_data_details
id source_data_id source_field_id value
1 1 1 1avhh2
2 1 2 john
3 1 3 mavrick
4 2 1 87k3jo
5 2 2 peter
6 2 3 lyne
How can I query it to make the result
source_data.id record_id firstname surname
1 1avhh2 john mavrick
2 87k3jo peter lyne