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.

Updated on: 22-Jun-2020

356 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements