Home > Database > Oracle > body text

How to determine whether data is empty in oracle

WBOY
Release: 2022-01-05 16:14:15
Original
27853 people have browsed it

In Oracle, you can use the is keyword to determine whether the data is empty. Because null is regarded as a special symbol in SQL, the equal sign cannot be used. The syntax is "select * from table where column is null" .

How to determine whether data is empty in oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How does oracle determine whether the data is empty

oracle determines whether a field is empty

For example

insert into table a (a1,b1)values("a1",'');
Copy after login

In this case, because the table stores '', there is actually no content. To query this field, you cannot directly use

select *
from a
where b1='';
Copy after login

The equal sign cannot be used to judge non-empty in sql, because null is in sql are regarded as special symbols and must use the keywords is and not

should be used like this:

select * from A where b1 is null
Copy after login

or:

select * from A where b1 is not null
Copy after login

Recommended tutorial: "Oracle Tutorial

The above is the detailed content of How to determine whether data is empty in oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template