Get the App
SLTechnology News&Howtos  ›  Database  › 

How does mysql query records whose fields are not empty

Shulou Source: shulou.com Published: 2022-05-31 11:36:21 10月27日 Update

This article mainly shows you the "mysql how to query the field is not empty records", the content is easy to understand, clear, hope to help you solve the doubt, the following let the editor lead you to study and learn "mysql how to query the field is not empty records" this article.

Query all records that are not empty

SELECT id,firstname,lastname,mail FROM testdb.users WHERE mailbox

Or

SELECT id,firstname,lastname,mail FROM testdb.users WHERE LENGTH (mail) > 0

The total number of records querying a table

SELECT count (*) FROM table_name

Or

SELECT count (*) as num FROM table_name

The above is all the contents of the article "how to query records whose fields are not empty by mysql". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Queries fields content articles learning help total easy to understand more organization knowledge editing industry information information channels channels research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft Docker OPPO Reno Shulou Information