-1

I need to convert this query from MsSql syntax to Oracle syntax:

select top 1 (convert(varchar, UPDATED_DATE, 23)) as date from DA_CATEGORY order by date desc

How do I do this? I need the data from both DB types to be the same string / value.

Tal Angel
  • 1,301
  • 3
  • 29
  • 63

1 Answers1

2

You can use the fetch clause as follows:

select to_char(UPDATED_DATE,'YYYY-MM-DD') as date 
from DA_CATEGORY 
order by UPDATED_DATE desc
fetch first row only
Popeye
  • 35,427
  • 4
  • 10
  • 31