TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

SQL SELECT NULL

SQL select null keyword with sql, tutorial, examples, insert, update, delete, select, join, database, table, join

<< Back to SQL

SQL SELECT NULL

First of all we should know that what null value is? Null values are used to represent missing unknown data.

There can be two conditions:

  1. Where SQL is NULL
  2. Where SQL is NOT NULL

If in a table, a column is optional, it is very easy to insert data in column or update an existing record without adding a value in this column. This means that field has null value.

Note: we should not compare null value with 0. They are not equivalent.

Where SQL is NULL:

How to select records with null values only? (in the marks column)

There is an example of student table:

SIR_NAMENAMEMARKS
TYAGISEEMA
SINGHRAMAN5.5
SHARMAAMAR
JAISWALVICKY6.2

Let's see the query to get all the records where marks is NULL:

SELECT SIR_NAME, NAME, MARKS FROM STUDENTS
WHERE MARKS IS NULL

It will return the following records:

SIR_NAMENAMEMARKS
SHARMAAMAR
TYAGISEEMA

Where SQL is NOT NULL:

How to select records with no null values(in marks column)? Let's see the query to get all the records where marks is NOT NULL

SELECT SIR_NAME, FIRSTNAME, MARKS FROM STUDENTS  
WHERE MARKS IS NOT NULL 
SIR_NAMENAMEMARKS
SINGHRAMAN5.5
JAISWALVICKY6.2
Next TopicSQL WHERE Clause




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf