IBM RPG400 Question: Download Questions PDF
Need a sql query: retrieve all duplicate records in table?
Answer:
let us assume we have some duplicate records in sample table
and we can identify duplicates with eid.
The the query looks like this.
Select * from sample
where eid=any
(select eid from sample having count(eid)>1 group by eid);
Note: This should be used SQl .. but i never tried in as400
when ever it is necessary means i use following sql
statement in as400 .......
select * from sample where eid=111
it displays all duplicate records related to 111
and we can identify duplicates with eid.
The the query looks like this.
Select * from sample
where eid=any
(select eid from sample having count(eid)>1 group by eid);
Note: This should be used SQl .. but i never tried in as400
when ever it is necessary means i use following sql
statement in as400 .......
select * from sample where eid=111
it displays all duplicate records related to 111
Download IBM RPG400 Interview Questions And Answers
PDF
Previous Question | Next Question |
How can we know running job is batch or interactive? | WHAT IS MENT BY RECORD LEVEL IDENTIFIER? WHAT IS THE PURPOSE OF THIS? |