5 lines
268 B
SQL
5 lines
268 B
SQL
CREATE VIEW activeQueryRequirements AS
|
|
SELECT q.id, q.type, q.activeVersion, rq.requiredQueryId
|
|
FROM queries q
|
|
JOIN requiredQueries rq ON q.id = rq.queryId
|
|
WHERE q.activeVersion >= rq.addedVersion AND q.activeVersion < COALESCE(rq.removedVersion, q.activeVersion + 1); |