From the course: Oracle Database 12c: Basic SQL
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Using WHERE IN and NOT IN for numbers - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
Using WHERE IN and NOT IN for numbers
- [Instructor] The SQL where in and not in clause is not just limited to string values, we can also use it with numeric values for example. So let's start by selecting the first_name, last_name and department_id columns of our employees table. Assuming that we only want to see employees whose department_id is 90 or 100, we can just type where department_id in and type the department_id values, for example, 90 comma 100. Note that we don't have to place these values inside quotation mark because these are numeric values, numbers, and not string values. Running this query will give us the desired output, we only see employees assigned to department_id 90 and employees assigned to department_id 100. We can also change in to not in similarly to our previous example using string values. Running this query will provide us with the desired output, all employees who are not assigned to department_id 90 or 100, and of course we are not just limited to two values inside our brackets, we can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Writing your first SELECT query1m 56s
-
(Locked)
Selecting only specific columns2m 22s
-
(Locked)
Using WHERE to filter specific rows1m 55s
-
(Locked)
Using multiple WHERE conditions3m 55s
-
(Locked)
Using WHERE to filter partial strings3m 12s
-
(Locked)
Using WHERE to filter numeric ranges1m 17s
-
(Locked)
Using WHERE IN and NOT IN for strings1m 54s
-
(Locked)
Using WHERE IN and NOT IN for numbers1m 35s
-
(Locked)
Using WHERE to filter dates2m 42s
-
(Locked)
Using WHERE to filter exact strings1m 55s
-
(Locked)
Using DISTINCT to eliminate duplicates4m
-
(Locked)
Performing basic numeric calculations2m 23s
-
(Locked)
Using column aliases2m 18s
-
(Locked)
Describe the structure of a table3m 16s
-
(Locked)
Using ORDER BY3m 29s
-
-
-
-
-
-
-