开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜