Created
June 13, 2013 20:51
-
-
Save eddiejhong/5777234 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 popular_crosslinks | |
SET slug = NULL; | |
UPDATE popular_crosslinks | |
SET slug = CONCAT("/", LOWER(degree_level_proper)) | |
WHERE degree_level IS NOT NULL; | |
UPDATE | |
-- SELECT slug,search_term_url FROM | |
popular_crosslinks | |
INNER JOIN search_term | |
ON popular_crosslinks.search_term = search_term.name | |
SET slug = COALESCE(CONCAT(slug, "/", search_term_url), CONCAT("/", search_term_url)) | |
WHERE popular_crosslinks.search_term IS NOT NULL; -- ORDER BY search_term_url | |
UPDATE popular_crosslinks | |
SET slug = COALESCE(CONCAT (slug, "/", REPLACE(LOWER(category), " ", "-")), CONCAT("/", category)) | |
WHERE category IS NOT NULL AND search_term IS NULL; | |
UPDATE popular_crosslinks | |
SET slug = CONCAT(slug, "/"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment