views:

51

answers:

3

I need to select a table sorted as a "Queue", the least recent to most recent row. Exists something feature that enable me to do this?

+1  A: 

You need at least a column that represent a moment in time, like a date column. Then you order by that field:

SELECT * FROM Employee ORDER BY BirthDate
Pierre-Alain Vigeant
+3  A: 

At the very least, if you have an IDENTITY/AUTONUMBER, or at least a DATE to sort by you could

SELECT *
FORM Table
ORDER BY DateColumn

Or

SELECT *
FORM Table
ORDER BY IDColumn
astander
Just keep in mind that there is no guarantee that IDENTITY columns will be in sequential order of the time at which they were inserted
Tom H.
Aggreed, but with no structure provided, this should cover some of th OP's possibilities.
astander
A: 

If you don't mean "ORDER BY", do you mean use a table as concurrency-safe message queue?

Like this: SQL Server Process Queue Race Condition?

gbn