Home  >  Article  >  Database  >  How to query fields that are not empty in mysql

How to query fields that are not empty in mysql

PHPz
PHPzforward
2023-04-17 22:34:013739browse

Mysql query field is not empty method: 1. Use "select * from table_name where id a8093152e673feb7aba1828c43532094 "";" statement query; 2. Use "select * from table_name where id != "";" statement query.

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to query the fields that are not empty in mysql

1. Query that the fields are not empty

select * from table where id <> "";
select * from table where id != "";

How to query fields that are not empty in mysql

How to query fields that are not empty in mysql

# #2. The query is empty

select * from table where id ="";
select * from table where isNull(id);

If the field is of type char or varchar, it is OK to use id=""; if the field is of type int, it is better to use isNull.

How to query fields that are not empty in mysql

The above is the detailed content of How to query fields that are not empty in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete