-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
  • 783
  • 1
  • 14
  • 38

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,354
  • 4
  • 8
  • 30