You are currently reviewing an older revision of this page.
Sometimes users might need to add a additional query to an already existing one that is being used to populate a value select list in the ProjectWise.
In this scenario we have a already existing query that returns a list by filtering it trough filter attribute and a form value(filter and some_attribute) it returns us a list, but we need to have a fixed amount of values added to a list that can be accessed by using another filter value.
So if original query(Select name, description from env_table_name where filter = ‘filter name’ AND some_attribute = '$EDIT#Attribute1$’ ORDER BY sort_attribute) would return:
Value 1
Value 2
Value 3
And additionalquery(Select name, description from env_table_name where filter = ‘some value’ ORDER BY sort_attribute)would return:
Test1
Test2
Test3
The end result we are going for is:
Value1
Value2
Value3
We could use UNION operator but this is a rather highly depending on format and might not work at all so the best way to go around in this case is to use OR operator:
SELECT name, description from env_table_name where filter = ‘filter name’ AND( some_attribute = ‘$EDIT#Attribute1$’ OR filter = ‘some value’) ORDER BY sort_attribute