Database view - union
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 08:16 AM
Hi All,
I am looking to Union 3 DB tables (incident, problem, change_request) to get the joint result set with common fields. I would appreciate if you can guide me in right direction.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 08:30 AM
Hi,
It is possible to create a database view joining n number of tables. Below is an example of the same:
This view joins the data from three different tables, i.e., incident, metric_instance and metric_definition.
You need to define a variable under Variable prefix column for each of the tables used and then use this variable to relate to a field from another table under the Where clause column with the appropriate condition.
Let me know in case you need further help with building the view..
PS: Mark this answer as Correct if it solved your query or hit Like/Helpful depending upon the usefulness of the response.
Regards,
Supriya Bisht
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2017 08:37 AM
Hi Supriya,
Thanks for the quick reply.
Our requirement is to get the result set from 3 tables into 1 with Union or equitant. Number of columns should remain same regardless of number of Unions.
Join gets columns from different tables. More number of joins mean, more number of columns. This approach is not suitable for us.
Any ideas.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2017 04:48 AM
Hi GK,
I have also the same requirement. Is your Issue is resolved. If yes, then how you achieved it.
Thanks
Best regards,
Pratap Ranawat

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2017 06:13 AM
You can try reporting on Task table with Group by as Task Type.