- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What would happen if we run SELECT WHERE columnName = zero in MySQL?
The following syntax will fetch all the values from the column −
select * from yourTableName where yourColumnName=0;
Let us first create a table −
mysql> create table DemoTable1791 ( FirstName varchar(20) ); Query OK, 0 rows affected (0.00 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1791 values('David'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1791 values('John'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1791 values('Carol'); Query OK, 1 row affected (0.00 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1791;
This will produce the following output −
+-----------+ | FirstName | +-----------+ | David | | John | | Carol | +-----------+ 3 rows in set (0.00 sec)
Here is the query wherein we are implementing select where value is zero −
mysql> select * from DemoTable1791 where FirstName=0;
This will produce the following output
+-----------+ | FirstName | +-----------+ | David | | John | | Carol | +-----------+ 3 rows in set, 3 warnings (0.00 sec)
- Related Articles
- What will happen if we directly call the run() method in Java?
- What would happen if there were no Moon?
- What would happen if earth did not rotate or revolve?
- What would happen if Earth started to rotate in the opposite direction?
- If wheat is sown in the kharif season, what would happen? Discuss.
- What would happen if the ozone layer in the atmosphere completely disappears?
- What would happen if we insert empty values in a table with a column set as type TIMESTAMP CURRENT_TIMESTAMP?
- What would happen if someone eats Maggi all day or everyday?
- What would happen to iron railings if they are not painted?
- What would happen if gravitational force of the Sun suddenly vanishes?
- What would happen if the plasma membrane ruptures or breaks down?
- SELECT WHERE IN null in MySQL?
- What happen if we concatenate two string literals in C++?
- What is the purpose of ORDER BY columnname*1 in MySQL?
- If you run a magnet over paper pins, what would you observe?