Hello
I want to get all rows from a table where "Title" column beginning with any number. What should I use in Like operator. I am using MySql.
thanks.
Need help
Moderator: General Moderators
- vargadanis
- Forum Contributor
- Posts: 158
- Joined: Sun Jun 01, 2008 3:48 am
- Contact:
Re: Need help
Hi!
I know a simple way to do it but it is very unsophisticated:
I know a simple way to do it but it is very unsophisticated:
Code: Select all
SELECT * FROM `table` WHERE nev LIKE '0%' OR '1%' OR '2%' OR '3%' OR '4%' OR '5%' OR '6%' OR '7%' OR '8%' OR '9%'Re: Need help
You can use regular expressions in SQL...
Code: Select all
SELECT *
FROM `table`
WHERE 1
AND `title` REGEXP '^[[:digit:]].*'- vargadanis
- Forum Contributor
- Posts: 158
- Joined: Sun Jun 01, 2008 3:48 am
- Contact:
Re: Need help
Here we go.. I told u mine was a simple solution..
Re: Need help
shakeel, in the future, please do not use vague, general Subjects like "Need help." Those of us who spend a lot of time in this forum do not usually even read such posts. If the questioner doesn't have enough interest to give us an indication of what kind of help is requested, we just skip them.
- vargadanis
- Forum Contributor
- Posts: 158
- Joined: Sun Jun 01, 2008 3:48 am
- Contact:
Re: Need help
Next time, please, put some info in the subject of the topic so that more peeps might pay attention. 