Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql's method to check whether the field is empty

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you mysql to check whether the field is empty, I hope you have learned a lot after reading this article, let's discuss it together!

Mysql's method to check whether the field is empty: 1. The query is not empty and the code is [Select * From table_name Where idled empty fields']; 2, the query is empty and the code is [Select * From table_name WhereISNULL (I)].

Mysql's method to check whether the field is empty:

Different databases in the sql standard use different functions. Today, we found that the query ranking function in mysql does not support top in MySQL. This top function is a function of sql server.

Briefly talk about the null and non-empty query methods in MySQL. Null divided into empty string''; and null

1. Not empty

Select * From table_name Where id''Select * From table_name Where idlers

2. Empty

Select * From table_name Where id=''Select * From table_name Where ISNULL (id)

Specific analysis, if the field is char and Varchar type can use id=''; if the int type is better with ISNULL.

After reading this article, I believe you have a certain understanding of the method of mysql to check whether the field is empty. You want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report