-
-
Save jorik041/5843952 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Update record revision numbers for a region, so they display in Perch. | |
-- Replace :regionID and :revisionNum | |
UPDATE perch2_content_items pci | |
INNER JOIN | |
( | |
SELECT | |
itemID, | |
MAX(itemRev) AS itemRevMax | |
FROM perch2_content_items | |
WHERE regionID = :regionID | |
GROUP BY itemID | |
) AS max | |
ON pci.itemID = max.itemID AND pci.itemRev = max.itemRevMax | |
SET pci.itemRev = :revisionNum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment