Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DB2 :: RE: Need DB2 query to fetch previous row !

$
0
0
Author: RahulG31
Subject: Reply to: Need DB2 query to fetch previous row !
Posted: Mon Jun 05, 2017 9:35 am (GMT 5.5)

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).

.


Viewing all articles
Browse latest Browse all 8500

Trending Articles