mysql search number in table
i am using php/mysql.
i have a product table . in which most product have starting name with number.
i want to list开发者_运维技巧out all products start with any number.
any one have idea about it....
Ref this
SELECT * FROM product WHERE name REGEXP '^[0-9]'
from what i understant, your product names are something like '123myproduct'. you should be able to search the table with
select * from product where name like '123%';
The LIKE construct uses '%' as a wildcard that means 'anything'
I hope this will help you
Jerome Wagner
精彩评论