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 to filter partial strings

Using WHERE to filter partial strings - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

Using WHERE to filter partial strings

- [Instructor] We are not only restricted to filtering our data using numbers, we can also filter based on certain string values. So for example, instead of asking the database to return all employees who has a certain salary, or are assigned to specific departments based on the department number, let's see how we can return all employees whose first name start with the letter E. So let's delete the WHERE condition, keeping the WHERE keyword, and type first_name like, which can be lowercase or uppercase, similar to other reserved word in our SQL query, and then specify the condition. So for example, if I want all employees whose first name starts with the letter E, I'll type LIKE, add a quotation mark, because I'm going to filter based on string values characters instead of numbers, the letter E and then the percentage symbol, followed by another quotation mark. This instructs Oracle to search for rows where the value in the first name column starts with the letter E. The percentage…

Contents