Last active
November 22, 2016 07:25
-
-
Save fiftin/f28d74431f10d6ae6a3f0da7d608ed05 to your computer and use it in GitHub Desktop.
Count the number of occurrences of a char in MySQL
This file contains hidden or 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 Entities SET depth = (LENGTH(path) - LENGTH(REPLACE(path, '/', ''))) + 2 WHERE path <> ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment