Page 1 of 1

selecting rows that contain pattern as a subset

Posted: Sat Oct 08, 2005 5:14 pm
by jaymoore_299
I have a table with only one column with values like
row1 = a123 , row2 = 231 , row3 = 1233 , row4 = 123

how would I select all rows that contain "123" so that rows 1 , 3 , 4 would be a match?

Posted: Sat Oct 08, 2005 5:22 pm
by feyd
look up LIKE syntax:

Code: Select all

SELECT * FROM `table` WHERE `field` LIKE '%123%'