Select query with IN Operator

Select query with IN Operator

SELECT * FROM table_name WHERE columnname IN (value1,value2,…);

Example 1:

Find data for muliple values for specific column

SELECT * FROM employees WHERE Country IN (‘INDIA’,’UK’);

Example 2:

Use the in operator in sub query also

select * from employee where deptno in ( select department_no from departments);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.