View previous topic :: View next topic
|
Author |
Message |
ilakkia Warnings : 1 New User
Joined: 17 May 2008 Posts: 28 Location: chennai
|
|
|
|
How to select the values only from the last row of a table? |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
'Last row of a table' has no real meaning. This is DB2. You are not supposed to know how the data are arranged physically in the DB2/VSAM table/file.
Do you want to know a MAX value of some column? |
|
Back to top |
|
|
ilakkia Warnings : 1 New User
Joined: 17 May 2008 Posts: 28 Location: chennai
|
|
|
|
I want to fetch the last updated row of a table? |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Illakkia,
If your table has something like a ROW CHANGE TIMESTAMP. Its possible.
Otherwise refer the previous post.
Sushanth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I want to fetch the last updated row of a table? |
For what reason? While you are reading the "the last one", others may be updated causing the one read to no longer be "last". . .
What business requirement will this support? |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
its possible if you have an indicator variable in the table.. reset the indicator variable on the row which is to be updated and query accordingly.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
its possible if you have an indicator variable in the table.. reset the indicator variable on the row which is to be updated and query accordingly.... |
This might have a chance at working on a table with very low add/update activity. Logically, one could believe in this, but in a busy environment, it would fail.
For example, some of my tables are updated several thousand times a minute. . . . |
|
Back to top |
|
|
|