Home  >  Article  >  Database  >  How can we use two columns in MySQL WHERE clause?

How can we use two columns in MySQL WHERE clause?

WBOY
WBOYforward
2023-09-06 09:41:021175browse

我们如何在 MySQL WHERE 子句中使用两列?

Two columns of the same table are rarely used in the WHERE clause, but we can still use two columns of the same table to perform queries. Consider the following example -

mysql> Select F_name, L_name
    -> From Customer
    -> where F_name = L_name;
    Empty set (0.00 sec)

Here we are using two columns (F_Name and L_Name) from the same table (Customer), so the result is an empty set.

The above is the detailed content of How can we use two columns in MySQL WHERE clause?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete