問題タブ [string-function]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
mysql - MySQL の BIT_LENGTH(str) 関数と LENGTH(str) 関数の違い
MySQL開発サイトにあるように-
BIT_LENGTH(文字列) -
文字列 str の長さをビット単位で返します。
長さ(文字列) -
文字列 str の長さをバイト単位で返します。マルチバイト文字は複数バイトとしてカウントされます。
いくつかのサンプル結果 -
したがって、最初の結果はビット単位で、2 番目はバイト単位で、8 ビット = 1 バイトです。
したがって、result1 = 8 * result2;
また、
ここでも、result1 = 8 * result2;
したがって、2 つの関数の違いは単純に、BIT_LENGTH(str) は結果をビット単位で返し、LENGTH(str) は結果をバイト単位で返すことです。
またはそれ以上の違いはありますか?