tags:

views:

42

answers:

2

hi,

i am using php/mysql.

i have a product table . in which most product have starting name with number.

i want to listout all products start with any number.

any one have idea about it....

+7  A: 

Ref this

SELECT * FROM product WHERE name REGEXP '^[0-9]'
Salil
A: 

Hello, 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

Jerome WAGNER
from question "start with any number" it is clearhe want result which start with any number.your query fails if it start with any other than '123'
Salil
yep. I misread the question. Your answer does the trick.
Jerome WAGNER