More SQL Commands
In this lesson, we will further elaborate on SQL commands.
We'll cover the following...
We’ve seen how to search for an exact match. Now let’s see how to search for an approximate match using SQL’s wild card searches.
Searching for approximate matches
If we wanted to search for all the journal entries that contain the word “Time” we could execute the following SQL:
SELECT CreatedTimestamp, Body FROM journal_entries WHERE Body LIKE '%Time%';
Whatever is between the %
signs is the wildcard. This query returns the time stamp and journal entry for every row that contains the wildcard in the Body column. It doesn’t matter what comes before the wild card, what comes after the wildcard, or if the Body just ...