Difference between revisions of "IN OPERATOR"

From rbachwiki
Jump to navigation Jump to search
(Created page with "The IN operator returns records matching one of the values listed in the condition. Oracle 11g syntax requires separating list items with commas, and the entire list must be e...")
 
 
Line 10: Line 10:
  FROM customers
  FROM customers
  WHERE state IN('CA','TX');
  WHERE state IN('CA','TX');
SELECT firstname, lastname, state
FROM customers
WHERE state NOT IN('CA','TX');


[[#Rules for Dates|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]]
[[#Rules for Dates|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]]

Latest revision as of 18:09, 24 October 2017

The IN operator returns records matching one of the values listed in the condition. Oracle 11g syntax requires separating list items with commas, and the entire list must be enclosed in parentheses.

SELECT title, pubid
FROM books
WHERE pubid IN (1,2,5);
SELECT firstname, lastname, state
FROM customers
WHERE state IN('CA','TX');
SELECT firstname, lastname, state
FROM customers
WHERE state NOT IN('CA','TX');

Back To Top- Home - Category