View previous topic :: View next topic
|
Author |
Message |
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi all,
in my requirement there are some timestamps for each product(ex. 5 products are there). if i want to fetch the data of latest timestamp, how to achieve it?
Thanks!
Rathna. |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Hi,
You can use this code
Code: |
EXEC SQL
SELECT MAX(TIMESTAMP(:WS-FIRST-TIMEST),TIMESTAMP(:WS-SECOND-TIME-ST)
INTO :MAX-TIME-ST
FROM SYSIBM.SYSDUMMY1
END-EXEC
|
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Code: |
SELECT *
FROM QUAL.MYTABLE
WHERE TIMESTAMPCOL = SELECT MAX(TIMESTAMPCOL) FROM QUAL.MYTABLE |
With something like this, you will get the one row having the highest timestamp. |
|
Back to top |
|
|
|