Search code snippets, questions, articles...

Searching or Like Query in Sql

Like query in SQL can be used to search through one column or multiple columns in a table.
SELECT column_name_1, column_name_2
FROM table_name
WHERE column_name_2 LIKE %q%;
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

Here are some pattern examples that can be helpful while creating Like query in SQL

LIKE 'w%' - Return rows where column values start with "w"

LIKE '%w' - Return rows where column values  that end with "w"

LIKE '_w%' - Return rows where column values  that have "w" in the second position

LIKE 'w_%' - Return rows where column values  that start with "w" and are at least 2 characters in length

LIKE 'w__%' - Return rows where column values that start with "w" and are at least 3 characters in length

LIKE '%he%' - Return rows where column values  that have "he" in any position

LIKE 'w%e' - Return rows where column values that start with "w" and end with "e"

Search Index Data (The code snippet can also be found with below search text)

like query SQL
Search in SQL using column values
Was this helpful?
0 Comments