tags:

views:

203

answers:

1

I'm trying to return all rows that content substring in mysql

and here is my code

SELECT        Last_Name, Midle_Name, First_Name, Phone_home
FROM            contact_info
LOCATE   (@prefixText, Last_Name)

but I'm getting error.

please help me with correct syntax for LOCATE in my case. Thank you

+1  A: 

You need a WHERE clause:

SELECT Last_Name, Midle_Name, First_Name, Phone_home
FROM   contact_info
WHERE  LOCATE(@prefixText, Last_Name) != 0
Mark Byers
Thank you for help
Eyla