I have table when there is any changes in row it shows in column change_type_cd is 'U'.i need query like when someone updates the query then I can fetch the original record along with the updated record to compare their values.
Thanks in adv.
Does your table has any primary key? If yes, then you won't be able to Insert another row without changing the primary key i.e. another row with same values barring some column that is updated and a change_column as 'U'. Since the new inserted row (with 'U') will have a different primary key value, you'll Not be able to uniquely identify which row was changed unless you have some other column combination to identify a row uniquely.
If your table doesn't have a primary key then you can have many rows which are replica of each other. In that case, you won't be able to tell which row was updated (or shall I call Inserted with a 'U' column).
You really need to provide us with some sample data about what you want to achieve and primary key and other relevant information (such as if you have a timestamp column in table).
Assuming you do insert a row (second time) with change_column as 'U' and your original row still has change_column <> 'U'. So hence forth all your updates to this unique record is performed on second row and first row is untouched. In that case you can try this.
select * from table1 A
where exists ( select 1 from table1 B
where A.key1 = B.key2
and B.change_column = 'U' )