开发者

Locate Syntax in mysql

开发者 https://www.devze.com 2022-12-20 17:40 出处:网络
I\'m trying to return all rows that contain a substring in mysql and here is my code SELECTLast_Name, Midle_Name, First_Name, Ph开发者_如何学JAVAone_home

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

and here is my code

SELECT        Last_Name, Midle_Name, First_Name, Ph开发者_如何学JAVAone_home
FROM            contact_info
LOCATE   (@prefixText, Last_Name)

but I'm getting an error.

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


You need a WHERE clause:

SELECT Last_Name, Midle_Name, First_Name, Phone_home
FROM   contact_info
WHERE  LOCATE(@prefixText, Last_Name) != 0
0

精彩评论

暂无评论...
验证码 换一张
取 消