learn-request-queue/db/50-views.sql

6 lines
181 B
SQL

CREATE VIEW requests_vw AS
SELECT * FROM requests WHERE state = 'Requested' ORDER BY score DESC, id DESC;
CREATE VIEW requests_all_vw AS
SELECT * FROM requests ORDER BY id DESC;