Jan 24 2022 08:12 AM
Good morning, I am new to this topic, please help me with the following. Thank you very much
With ROW_NUMBER() OVER I am trying to insert in a field a sequential number for each row of two tables. This works for me if I apply it for all rows of a single table. How can I do it for two or more joined tables? Or what other function or technique can I use?
This is the sentence
SELECT
ROW_NUMBER() OVER(ORDER BY IC.IDP ASC) [Consecutivo]
,IC.IDP [Id del P]
,IC.FECHA [Fecha en tabla IC]
,IM.FECHA [Fecha en tabla IM]
FROM TABLA_IC IC
inner join TABLA_IM IM ON IM.IDPM = IC.IDP
where IC.IDP = 106
Which only brings me the records of TABLA_IC
But I want to get the records from both tables TABLA_IC and TABLA_IM. So
Jan 25 2022 01:30 PM
SolutionJan 26 2022 07:28 AM
Jan 25 2022 01:30 PM
Solution