Solved

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

Posted on 2015-02-23
3
35 Views
Last Modified: 2015-02-23
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?
0
Comment
Question by:brucegust
3 Comments
 
LVL 1

Expert Comment

by:justaphase
ID: 40626004
Define your colletion records?
From MySQL, MsSQL a PHP Array?
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 40626178
If it's MySQL, then this'll do it:

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

Open in new window

0
 

Author Comment

by:brucegust
ID: 40626569
Perfect, Chris!

Thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now