For Microsoft SQL Server I could use something similar but different due to differences in syntax:
SELECT ... FROM EMAILQUEUE_STATUS WHERE STATUS = 'Ready' AND ROWNUM = 1 ORDER BY TIME_STAMP DESC
Here's the catch. I need a single query statement that will work with the same syntax for both Oracle and Microsoft SQL Server. I'm thinking some kind of group by or partition might be the way to go but I'm not quite figuring it out. Anyone have any ideas?
SELECT TOP(1) ... WHERE STATUS = 'READY' ORDER BY TIME_STAMP DESC
From novice to tech pro — start learning today.