The following subquery successfully identifies duplicate description table entries in an Oracle database. The result of this query is automatically transferred to the business functional team (customer) for them to fix through the front end application (Oracle EBS).
How can I display the column names in the results of this SQL subquery? My research suggests adding a UNION could be the solution; however, I am struggling trying to determine where to place the UNION in the subquery.
Along with the query results, the 5 coulumn names I want to display on the first line are 'FLEX_VALUE', 'DESCRIPTION', 'FLEX_VALUE_SET_NAME', 'SUMMARY_FLAG', and 'ENABLED_FLAG'.
Thank you for any assistance you can provide.
Tim
SQL:
Select apps.ffvvo.flex_value, apps.ffvvo.description, apps.ffvso.flex_value_set_name, apps.ffvvo.summary_flag, apps.ffvvo.enabled_flag
From apps.fnd_flex_values_vl ffvvo left outer join apps.fnd_flex_value_sets ffvso on apps.ffvvo.flex_value_set_id = apps.ffvso.flex_value_set_id
Where apps.ffvvo.flex_value != 'T' and apps.ffvvo.Description in (
Select apps.ffvv.Description
from apps.fnd_flex_values_vl ffvv left outer join apps.fnd_flex_value_sets ffvs on apps.ffvv.flex_value_set_id = apps.ffvs.flex_value_set_id
where apps.ffvs.flex_value_set_name in ('CTPA_ACCOUNT','CTPA_ACTIVITY','CTPA_CENTER','CTPA_FUND','CTPA_FUTURE','CTPA_PROJECT')
Group by apps.ffvv.Description having count(ffvv.flex_value) > 1
)
Order By apps.ffvvo.description;
How can I display the column names in the results of this SQL subquery? My research suggests adding a UNION could be the solution; however, I am struggling trying to determine where to place the UNION in the subquery.
Along with the query results, the 5 coulumn names I want to display on the first line are 'FLEX_VALUE', 'DESCRIPTION', 'FLEX_VALUE_SET_NAME', 'SUMMARY_FLAG', and 'ENABLED_FLAG'.
Thank you for any assistance you can provide.
Tim