IN

 

IN


The IN operator is useful for working with both numeric and text columns. This operator allows you to use an =, but for more than one item of that particular column. We can check one, two or many column values for which we want to pull data, but all within the same query.

Questions using IN operator


  1. Use the accounts table to find the account nameprimary_poc, and sales_rep_id for Walmart, Target, and Norstrom.


  1. SELECT name, primary_poc, sales_rep_id FROM accounts WHERE name IN ('Walmart', 'Target', 'Nordstrom');

2. Use the web_events table to find all information regarding individuals who were contacted      via the channel of organic or adwords.

  1. SELECT * FROM web_events WHERE channel IN ('organic', 'adwords');

Comments

Popular posts from this blog

Entity Relationship Diagrams

Arithmetic Operators

NOT