SQL LIKE

The LIKE command allows you to do string matching (with wildcards).

-- Works in PostgreSQL, MySQL, SQL Server, and Oracle SELECT * FROM buildings WHERE address LIKE '%Main St';

buildings table

id address
1 123 Main St
2 2 Maple St
3 98 Main St
4 5 Maple St

Query results

id address
1 123 Main St
3 98 Main St