Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的数据库中有很多 blob 数据,我需要检索每个数据的权重(400kb、14,2kb 等)。
我怎样才能做到这一点?
在 SQL 中:
SELECT some_key, LENGTH(blob_column) AS size_in_bytes FROM the_table
在 PHP 中:
$sizes = array(); foreach (how_you_query_the_db('SELECT some_key, blob_column FROM the_table ') as $row) $sizes[$row['some_key']] = strlen($row['blob_column']);