SQL Query duplicate value
SQL query
---------------------
select * from (
SELECT
OPTION_ID,
INSTALLATION_DATE,
row_number() over (order by option_type ASC ) rownumber
FROM
v_device_options_details vdod
WHERE vdod.EQUIPMENT_ID = 1604 AND vdod.EQUIPMENT_TYPE='module' AND vdod.TYPE = 'Static'
) where rownumber between 0 AND 24;
Result:
-----------------------
OPTION_ID INSTALLATION_DATE ROWNUMBER
---------- ----------------- ----------
1009 1.4E+18 1
1009 2
1015 1.4E+18 3
1015 4
3921 1.4E+18 5
The above SQL giving me result for both row either installation_date is null or not null. I am looking if installation date has return two rows and one row is null and another is not null then it should display one row only which is not null installation date. but if there is only one row whatever it is null or not null then it should return that row only
0