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 strings - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
Using WHERE IN and NOT IN for strings
- [Instructor] Using SQL where in and where not in, allows us to more easily filter data based on multiple conditions or criteria. So let's see an example. We'll start by selecting the first name, last name and job ID of all employees in our employees' table. Assuming that we only want to see employees that hold the AD VP or IT PROG job IDs. One way to do it would be to type where job id equals IT PROG or job id equals AD VP. While this is a fully functional and correct SQL query, we have an easier way of matching data based on multiple values. We can just type where job ID in and provide a list of all of the values we wish to filter our data based on. So for example, where job ID in, and inside brackets, IT PROG in quotation marks, comma, AD VP in quotation marks. Running this query will present us with the same data. We can add two, three, four or more values inside our brackets. We can also change job ID to not in instead of in, which will return us all rows from our employees…
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
-
-
-
-
-
-
-