I begin with SQL server. I joined two tables. Both of them contain a column called "id".
After the inner join, I have now two columns with the same name ("id").
How can I fix this issue (- without typing all columns I want to keep. I have 200 columns -).
declare @contract_number nvarchar(255) = '2019.37080'
declare @reportingperiod nvarchar(255) = '2019-Q1'
select *
from ifrs17.output_bba
inner join ifrs17.unit_of_account
on unit_of_account.contract_number = output_bba.unit_of_account_number
and unit_of_account.reporting_period = output_bba.reporting_period
and unit_of_account.currency_source = output_bba.currency_source
where
output_bba.unit_of_account_number = @contract_number
and output_bba.meta_id in ( select max(meta_id) from ifrs17.output_bba where contract_number = @contract_number and legal_entity_code = 'SR' group by reporting_period )
and unit_of_account.meta_id in ( select max(meta_id) from ifrs17.unit_of_account where contract_number = @contract_number and legal_entity_code = 'SR' group by reporting_period )
and output_bba.time_index > 0
and output_bba.reporting_period = @reportingperiod