
- 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
How can we use two columns with MySQL WHERE clause?
It is very rarely used to use two columns of the same table in WHERE clause but still we can perform a query with two columns of the same table. Consider the below example −
mysql> Select F_name, L_name -> From Customer -> where F_name = L_name; Empty set (0.00 sec)
Here we are using both the columns(F_Name and L_Name) from the same table(Customer) hence the result is an Empty set.
- Related Articles
- How Can we use MySQL DISTINCT clause with WHERE and LIMIT clause?
- How can we use ASCII() function with MySQL WHERE clause?
- How can we use CHAR_LENGTH() function with MySQL WHERE clause?
- How can we use BIN() function with MySQL WHERE clause?
- How can we use FIND_IN_SET() function with MySQL WHERE clause?
- How can we use MySQL INSTR() function with WHERE clause?
- How can we use WHERE clause with MySQL INSERT INTO command?
- Can we use MySQL GROUP BY clause with multiple columns like MySQL DISTINCT clause is used?
- Can we use WHERE clause inside MySQL CASE statement?
- How can we use MySQL REVERSE() function on column’s data along with WHERE clause?
- How can I use SPACE() function with MySQL WHERE clause?
- Can we fetch multiple values with MySQL WHERE Clause?
- How can we use MySQL SUM() function with HAVING clause?
- How can we use a MySQL subquery with FROM clause?
- How to use MySQL VIEW with WHERE clause?

Advertisements