Logical Operators: PostgreSQL AND, OR and NOT

  • Post comments:0 Comments
  • Reading time:3 mins read
  • Post category:SQL

In the previous post, we learned about how we restrict the results using where clause, now we will learn more about sql where clause with logical operators in SQL. The three important logical operators are PostgreSQL and, or and not.

Also read, PostgreSQL where clause

Logical Operators: PostgreSQL

A logical condition combines the two-component conditions to produce a single result based on those conditions or it inverts the result of a single condition.
A row is returned only if the overall result of the condition is true.

There are 3 logical operators present in SQL

1. AND
2. OR
3. NOT

Examples for each of the above Logical Operators is listed below.

PostgreSQL AND Operator

Here we have selected ename starting with ‘S’ whose job is ‘CLERK’

PostgreSQL OR operator

OR is an operator that filters the result set to only include rows where either condition is true.

PostgreSQL NOT operator

Words from postgreshelp

Thank you for giving your valuable time to read the above information. I hope the content served your purpose in reaching out the blog.
Suggestions for improvement of the blog are highly appreciable. Please contact us for any information/suggestion/feedback.

If you want to be updated with all our articles

please follow us on Facebook Twitter
Please subscribe to our newsletter.

 

Leave a Reply