xquery - function to get max timestamp

N

nlounello

How can I use the max function to get the record with the max
timestamp?

I'm thinking of using xmlexists but i'm having trouble knowing where
exactly to place it.

For example:
SELECT * FROM COMPANY
WHERE XMLEXISTS('$f//Company/Department/Employee@update_ts'
passing XML_COLUMN as "f")

<Company>
<Department>
<Employee startDate="mm/dd/yyyy"
update_ts="2007-11-01-17.59.40.285000">
<Name>John Doe</Name>
</Employee>
</Department>
</Company>

Thanks so much for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top