Detailed explanation of how to write mysql not equal to null and equal to null

Detailed explanation of how to write mysql not equal to null and equal to null

1. Table structure

2. Table data

3. The query teacher_name field cannot be equal to empty and cannot be equal to the empty character

SELECT * FROM sys_teacher WHERE teacher_name IS NOT NULL AND teacher_name <>''

Query results:

4. Query the teacher_name field to be equal to null or equal to an empty character

SELECT * FROM sys_teacher WHERE teacher_name = '' OR teacher_name IS NULL

Query results:

This is the end of this article about how to write MySQL not equal to null and equal to null. For more relevant content about MySQL not equal to null and equal to null, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • 9 Explanations of Null in Java (Java Null Detailed Explanation)
  • What is Null in Java
  • How to handle NULL values ​​in SQL statements
  • Parsing null and NULL in JAVA and SQL

<<:  JavaScript to achieve stair rolling special effects (jQuery implementation)

>>:  Detailed tutorial on deploying Hadoop cluster using Docker

Recommend

In-depth understanding of the use of r2dbc in MySQL

Introduction MySQL should be a very common databa...

MySQL 5.7.17 and workbench installation and configuration graphic tutorial

This article shares the installation and configur...

JavaScript uses canvas to draw coordinates and lines

This article shares the specific code of using ca...

A detailed analysis and processing of MySQL alarms

Recently, a service has an alarm, which has made ...

How to set the default value of a MySQL field

Table of contents Preface: 1. Default value relat...

In-depth analysis of MySQL deadlock issues

Preface If our business is at a very early stage ...

How to use nginx to simulate canary release

This article introduces blue-green deployment and...

In-depth understanding of JavaScript callback functions

Table of contents Preface Quick Review: JavaScrip...

mysql5.5.28 installation tutorial is super detailed!

mysql5.5.28 installation tutorial for your refere...

Example of how to implement underline effects using Css and JS

This article mainly describes two kinds of underl...

How to Dockerize a Python Django Application

Docker is an open source project that provides an...

Analyze Mysql transactions and data consistency processing issues

This article analyzes the consistency processing ...

A brief discussion on the VUE uni-app life cycle

Table of contents 1. Application Lifecycle 2. Pag...