Sqlserver
 sql >> Base de données >  >> RDS >> Sqlserver

Comment mettre à jour et commander en utilisant ms sql

WITH    q AS
        (
        SELECT  TOP 10 *
        FROM    messages
        WHERE   status = 0
        ORDER BY
                priority DESC
        )
UPDATE  q
SET     status = 10