Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
9いいね 125回再生

SQL Tips Find Occurrences of Character #sqltips #sqlinterview #sql

Explanation:
LENGTH('banana'): Gives the length of the original string.
REPLACE('banana', 'a', ''): Removes all occurrences of the character 'a' from the string.
LENGTH(REPLACE('banana', 'a', '')): Gives the length of the string after removing all 'a' characters.
Subtracting the length of the modified string from the original string gives the number of times the character 'a' appeared.

コメント