I want to create a Database View using Database View and Table.

YoungJae Kim
Tera Contributor

Create a 'View' using tables A and B ( A is left join true )

 

I would like to create this view again in Database View.

Can I create a view again using Table C and the created view?

 

Plase Help.

 

 

 

 

8 REPLIES 8

It sounds like you don't want a left join on 300.  If it's working closer to your requirement with the left join, meaning no records are missing, you can create a before Query Business Rule using the database view as the table.  The script will exclude records without a short_description = 'Confirm'.

 

sorry. I think my explanation was insufficient.
 
Instead of only the 'Confirm' data coming out, need to get the Day value of the 'Confirm' data.

If there is no data in the Request Asset, Day can be displayed as null.
I would like to search based on the number of Hardware Assets.

 

Only when there is confirmed data in 'Request Asset'
I'm trying to get the Day value.

If no data is confirmed, Hardware Count should display Day as null.
(Using Left join)

 

The relationship between hardware assets and request assets is 1:N.

 

If there is no data with a Catalog Task value of Confirm in the 'Request Asset' table, it should be displayed as null.

 

current result

aaaa.png

 

The result I want is as follows.

aaaaaaa.png



This is hard to visualize and re-create with your custom table joining asset and catalog task, but with the current results you have shown it looks like maybe you could try a before Query Business Rule on the Database View as the table.  Your script will do a GlideRecord on the Database View ordering the results by the model (sys_id or display name) then Catalog Task Short Description (asc or desc, whichever causes Confirm to appear before null/(empty).  If you can get the results to return in this order then you would push each record to a new array if the model is different than the model on the previous record.  The end result of the script is that the new array is used to display the results. 

Danish Bhairag2
Tera Sage
Tera Sage

Hi @YoungJae Kim ,

 

I agree with Brad, we cannot create a database view using the table created out of it. Instead please create a database view where u can join table all 3 tables like table A - table B, table B- table C

 

Thanks,

Danish