How to aggregate records in a database view?

Christian62
Kilo Contributor

Hi,

I'm looking for some help on a database view. Basically, I have 2 custom sub tables (all extend the task table) which all reference records in another custom master table (again, extends the task table). The sub tables all have a many-to-one relationship with the master table.

I need to build an aggregated view of all of the records in the sub_tables and join these records to the master table records that they reference. Unfortunately I can't achieve this by joining the master table to the task table as each sub table has unique fields which we need in the view.

Any assistance would be greatly appreciated!

sub table 1

find_real_file.png

sub table 2

find_real_file.png

master table

find_real_file.png

desired database view

find_real_file.png

 

2 REPLIES 2

Deepak Kumar5
Kilo Sage

1) try with

master table (left join =true)

1st table 1sttable_referance = master_master_number

2nd table 2ndtable_referance = master_master_number

 

2) Create a DB view with master and 1st then 1st DB view and 2nd table

Christian62
Kilo Contributor

Hi Deepak - thanks for your response.

Unfortunately the first method doesn't work, and I'm not able to perform the second as you're not able to reference a database view from within a database view.

Any other thoughts on this?