-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
  • 862
  • 2
  • 20
  • 44

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
  • 34,995
  • 4
  • 9
  • 31