How can I retrieve rows beginning with either a "#" or a number?

I've got a table consisting of several hundred rows, all of them having a "term" column that can be easily sorted alphabetically with exception of 50 rows that have a term that starts with either a number or a "#" symbol.

How can I retrieve  just those rows that start with a number or the # sign?

Here's an example of the kind of data I'm talking about:

911 Surcharge
3DES
#BAL

What do you think?
brucegustPHP DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Chris StanyonConnect With a Mentor Commented:
If it's MySQL, then this'll do it:

SELECT column1, column2 FROM yourTable WHERE term REGEXP '^[0-9#]+';

Open in new window

0
 
justaphaseCommented:
Define your colletion records?
From MySQL, MsSQL a PHP Array?
0
 
brucegustPHP DeveloperAuthor Commented:
Perfect, Chris!

Thanks!
0
All Courses

From novice to tech pro — start learning today.