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

What you need to know about creating MySQL indexes

Table of contents Preface: 1. Create index method...

Detailed explanation of views in MySQL

view: Views in MySQL have many similarities with ...

Innodb system table space maintenance method

Environmental Description: There is a running MyS...

Idea configures tomcat to start a web project graphic tutorial

Configure tomcat 1. Click run configuration 2. Se...

Nginx routing forwarding and reverse proxy location configuration implementation

Three ways to configure Nginx The first method di...

Example of using CSS3 to create Pikachu animated wallpaper

text OK, next it’s time to show the renderings. O...

A brief analysis of crontab task scheduling in Linux

1. Create a scheduling task instruction crontab -...

Solution to "No input file specified" in nginx+php

Today, the error "No input file specified&qu...

An example of how to write a big sun weather icon in pure CSS

Effect The effect diagram is as follows Implement...

Using the outline-offset property in CSS to implement a plus sign

Assume there is such an initial code: <!DOCTYP...

Detailed explanation of the this pointing problem in JavaScript

Summarize Global environment ➡️ window Normal fun...

How to build a redis cluster using docker

Table of contents 1. Create a redis docker base i...

HTML table tag tutorial (31): cell width and height attributes WIDTH, HEIGHT

By default, the width and height of the cell are ...

How to quickly copy large files under Linux

Copy data When copying data remotely, we usually ...