Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL query WHERE length is longer than 1

Tags:

mysql

I want to only show results where the length of a BLOB is greater then 1.

like image 665
RussellHarrower Avatar asked Oct 25 '11 11:10

RussellHarrower


People also ask

How do I find the length of a string in a MySQL query?

The LENGTH() function returns the length of a string (in bytes).

How do I find the longest word in MySQL?

Learn MySQL from scratch for Data Science and Analytics To get the longest varchar length, you need to use CHAR_LENGTH().

Can we use length function with where clause in MySQL?

The LENGTH() (MySQL) or LEN() (MSSQL) function will return the length of a string in a column that you can use as a condition in your WHERE clause.

How do I select a specific length in SQL?

To query for string fields with a specific length, use the char_length() or length() from MySQL.


1 Answers

Try this:

SELECT * FROM your_table
WHERE OCTET_LENGTH(blob_field) > 1
like image 91
Marco Avatar answered Sep 22 '22 00:09

Marco