-
-
Save jeff/50f2999095e175c49362 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
-- Show copies that we would like to update from location 3819 to location 4870 | |
SELECT acp.id, acn.label, acp.location AS current_location, 4870 AS new_location | |
FROM asset.copy AS acp | |
JOIN asset.call_number AS acn ON acp.call_number = acn.id | |
WHERE acp.circ_lib = 108 | |
AND acp.location = 3819 | |
AND UPPER(acn.label) LIKE 'YA FAN%' | |
AND NOT acp.deleted | |
AND NOT acn.deleted; | |
-- Actually perform the update | |
BEGIN; | |
UPDATE asset.copy AS acp | |
SET location = 4870 | |
FROM asset.call_number AS acn | |
WHERE acp.call_number = acn.id | |
AND acp.circ_lib = 108 | |
AND acp.location = 3819 | |
AND UPPER(acn.label) LIKE 'YA FAN%' | |
AND NOT acp.deleted | |
AND NOT acn.deleted; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment