The SQL EXISTS Operator with WHERE condition

The SQL EXISTS Operator with WHERE condition

Instructor-svgAl-Mamun Sarkar
Apr 16 , 2020

The SQL EXISTS Operator with WHERE condition. The following SQL query shows how to use EXISTS while querying data from the database. 

 

SQL EXISTS Syntax:

SELECT column, column, ....
FROM table_name
WHERE EXISTS
(SELECT column FROM tablename WHERE condition);

Example:

SELECT name
FROM employees
WHERE EXISTS (SELECT amount FROM payments WHERE employee.id = payments.employee_id);

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram