Question : Getting "Incorrect Syntax near the Keywork 'Union''

When I execute this query

select 1 where 26 in
((select reporting_period_id from inv_uw_nav_version
where investment_id = 'ny0032009'
)
union  
(select reporting_period_id from inv_underwriting_setup
where investment_id = 'ny0032009'  ))

I get the error
Server Message:  Number  156, Severity  15
Incorrect syntax near the keyword 'union'.
Server Message:  Number  102, Severity  15
Incorrect syntax near ')'.

The sql query is executed fine.. Could u help me with this code?
thanks

Answer : Getting "Incorrect Syntax near the Keywork 'Union''

Joe had it right, just missing a few details:

select 1 where 26 in
(select a from
  (
    select a=reporting_period_id from inv_uw_nav_version
    where investment_id = 'ny0032009'
    union  
    select a=reporting_period_id from inv_underwriting_setup
    where investment_id = 'ny0032009'
  ) table_name_alias
)
Random Solutions  
 
programming4us programming4us