Search⌘ K
AI Features

More SQL Commands

Explore how to implement SQL wildcard searches that allow users to find their own journal entries securely. Understand the importance of generating user-specific queries to prevent unauthorized data exposure and learn a practical example using Java.

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:

MySQL
SELECT CreatedTimestamp, Body FROM journal_entries WHERE Body LIKE '%Time%';
...