Last active
June 20, 2016 06:29
-
-
Save xmorave2/936c3fdd24d8a1105c018dd4c331006c 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 biblio b JOIN biblioitems bi ON b.biblionumber = bi.biblionumber | |
SET b.copyrightdate = SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ExtractValue(bi.marcxml, '//datafield[@tag="264"]/subfield[@code="c"]'), "[", ""), "]", ""), "?", ""), "c", ""), "©", ""), "℗", ""), -4) | |
WHERE copyrightdate IS NULL AND frameworkcode = "KN"; | |
SELECT b.frameworkcode, b.biblionumber, b.copyrightdate, | |
SUBSTRING(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ExtractValue(bi.marcxml, '//datafield[@tag="264"]/subfield[@code="c"]'), "[", ""), "]", ""), "?", ""), "c", ""), "©", ""),"℗", ""), -4) as year | |
FROM biblio b JOIN biblioitems bi ON b.biblionumber = bi.biblionumber | |
WHERE copyrightdate IS NULL | |
LIMIT 10; | |
SELECT frameworkcode, count(*) FROM biblio WHERE copyrightdate IS NULL GROUP BY frameworkcode; | |
SELECT frameworkcode, count(*) FROM biblio WHERE copyrightdate = 0 GROUP BY frameworkcode; | |
UPDATE biblio SET copyrightdate = NULL WHERE copyrightdate = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment