IN predicate in Search condition in DB2 for i SQL |
It is used to get the rows that falls in the listed values in IN expression. For Example, refer to the Customer table and find out all the customer ids whose city in CHENNAI and KOLKATE.
SELECT * FROM customer WHERE CUSTCITY IN ('CHENNAI', 'KOLKATA')
Output:
CUSTID CUSTNAME CUSTCITY CUSTSTATE CUSTCOUNTRY 7 Mounish KOLKATA WEST BENGAL INDIA 8 Annamalai CHENNAI TAMIL NADU INDIA 9 Kannan CHENNAI TAMIL NADU INDIA