Home > Blockchain >  How can I count the number of bytes that have been inserted in a sqlite3 field?
How can I count the number of bytes that have been inserted in a sqlite3 field?

Time:11-01

I have a field that allows up to 40,000 NVARCHAR (40000) bytes to be inserted into. I now want to determine the number of bytes which users are actually inserting into the field so I can get the max, average, etc.
What query would I use to do that?

CodePudding user response:

Let's suppose the name of your table is target and the name of your field is data.

The following query will do this for you:

select length(data) from target;

The sqlite3 emoji and length function

  • Related