My current query:
SELECT DACTIONMILLIS, DACTIONDATE INTO WF_DACTIONMILLIS, WF_DACTIONDATE
FROM WORKFLOWHISTORY
WHERE ddocname=? and LOWER(DACTION)=?
and lower(DWFSTEPNAME)=?
and lower(DUSER)=?
and rownum = 1
ORDER BY DACTIONDATE desc;
But because the rownum is applied before the order by I'm getting invalid results. I found the following topic on stackoverflow: How do I limit the number of rows returned by an Oracle query after ordering? but that discusses a select, not a select into