SQL AND operator in DB2 for i SQL

SQL AND operator in DB2 for i SQL
SQL AND operator in DB2 for i SQL, SQL AND operator, SQL Tutorial, DB2 for i SQL, IBMI DB2
SQL AND operator in DB2 for i SQL

The AND operator is used with SQL WHERE clause. The AND operator is used to filter data based on one or more condition.

  • The AND operator displays a record if all the conditions are TRUE in the SQL WHERE clause used in the SQL Query.
  • Syntax using AND operator

    SELECT column1, column2, ...
    FROM table_name
    WHERE condition1 AND condition2 ...

    Example using SQL AND operator

    Find out all the customers of KERALA state and KOCHI city from the Cusotmer Table

    SELECT * FROM Customer WHERE CUSTSTATE = 'KERELA' and CUSTCITY ='KOCHI'
    CUSTID   CUSTNAME              CUSTCITY              CUSTSTATE             CUSTCOUNTRY
         4   Udeep                 KOCHI                 KERELA                INDIA      

    Post a Comment

    © AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain