I am trying to generate row number for the records but for the same record I am getting 2 unique row number. Is it possible if records are same then it generate the same unique number?
Example:
GENERIC_ID|Generic Name|HTA_INSERT_DT
2|Eculizumab|2021-02-10 05:50:28
7|Eculizumab|2021-02-10 05:50:28
9|Eculizumab|2021-02-10 05:50:28
in final output I want-
GENERIC_ID|Generic Name|HTA_INSERT_DT
2|Eculizumab|2021-02-10 05:50:28
2|Eculizumab|2021-02-10 05:50:28
2|Eculizumab|2021-02-10 05:50:28
I am running below sql query-
SELECT ROW_NUMBER() OVER(Order by (select NULL)) as GENERIC_ID
, a.`Generic Name`
, date_format(current_timestamp(),'yyyy-MM-dd hh:mm:ss') as HTA_INSERT_DT
from
(
Select distinct `Generic Name` from vw_non_onco_pharma
Union
Select distinct `Generic Name` from vw_plasma_protein
Union
Select distinct `Generic Name` from vw_non_onco_cell_gene
Union
Select distinct `Generic Name` from vw_onco_cell_gene
Union
Select distinct `Generic Name` from vw_onco_pharma
Union
Select distinct `Generic Name` from vw_non_onco_no_id
Union
Select distinct `Generic Name` from vw_onco_no_id
) a