Wednesday, May 18, 2011

SQL Query to Get Latest Record

Many times we get this need to find out the Latest Record written to the database.

Well, here is the simple/basic SQL query which works!!

SELECT * FROM SIEBEL.S_ADDR_ORG
WHERE CREATED  = (SELECT MAX(CREATED) FROM SIEBEL.S_ADDR_ORG);

Here CREATED Column  is the created date of the record.



Followers

Search This Blog