Here’s a way you can achieve what you describe:
SELECT name FROM user
WHERE 'John Smith and Peter Johnson are best friends' LIKE
CONCAT('%', name, '%')
More Related Contents:
- Join vs. sub-query
- Find records from one table which don’t exist in another
- How do I update if exists, insert if not (AKA “upsert” or “merge”) in MySQL?
- Natural Sort in MySQL
- MySQL get row position in ORDER BY
- Comparing date ranges
- Subqueries vs joins
- MySQL Results as comma separated list
- MySQL unknown column in ON clause
- MySQL not using indexes with WHERE IN clause?
- SQL: Find the max record per group [duplicate]
- Group by month and year in MySQL
- calculate a sum of type time using sql
- MySQL: Transactions vs Locking Tables
- Select TOP X (or bottom) percent for numeric values in MySQL
- How to create a multi-tenant database with shared table structures?
- MySQL #1140 – Mixing of GROUP columns
- MySQL select where column is not empty
- Hamming distance on binary strings in SQL
- Is it possible to have a default parameter for a mysql stored procedure?
- Renaming foreign-key columns in MySQL
- How to convert from varbinary to char/varchar in mysql
- MySQL GROUP BY behavior
- How to get rid of “Error 1329: No data – zero rows fetched, selected, or processed”
- Update multiple rows with one query?
- What does collation mean?
- What’s the correct name for an “association table” (a many-to-many relationship) [closed]
- sql pulling a row for next or previous row of a current row
- Row Rank in a MySQL View
- Select Rows with Maximum Column Value group by Another Column