Skip to content
Advertisement

how to avoid duplicate on Joining two tables

This result is 2 times A even after using disticnt . My expected result will have only one A. if i remove row_number() over() as rownum its working fine. Why this is happening ? how to resolve. AM using DB2!!

Advertisement

Answer

There are two rows in marks Table with id = 1 and mark = 50.. So you will get two rows in the output for each row in student table… If you only want one, you have to do a group By

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement