473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

select using LIKE where first character is a integer

hi,

i have some data in mysql in a column like this:
6.1.01 Financial Regulations
3.32.02 Academic Counseling

what iam selecting is select by letter A, B, C...Z. so my first char in
the column is always a integer, how can i select when the first few
characters are always a integer, i want to get rid of the integers and
run query on the word when selecting.

would greatly appreciate someone's help on this

Jul 3 '06 #1
2 9152

<co******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
hi,

i have some data in mysql in a column like this:
6.1.01 Financial Regulations
3.32.02 Academic Counseling

what iam selecting is select by letter A, B, C...Z. so my first char in
the column is always a integer, how can i select when the first few
characters are always a integer, i want to get rid of the integers and
run query on the word when selecting.

would greatly appreciate someone's help on this
Given these circumstances, it would probably be smarter to match on a more
complete string rather than just the first letter. You could use:
{fld} LIKE '%Financial %'
or
{fld} LIKE '%Academic %"

and this would get you past caring about the irregular leading numeric
digits.
OR
you might take advantage of the fact that the string you are looking for
begins just after the blank space " " that follows the number.

WHERE MID({fld}, LOCATE(' ', {fld})+1, 1) = 'A'

LOCATE() finds the first blank space and MID() shows you the string starting
with the first alpahabetic character that follows.

I like the first solution because it identifies the string more explicitly.
Thomas Bartkus
Jul 5 '06 #2
hy
try this

select * from barcode
where (SUBSTR(barcode, 1, 1) not between '0' and '9')
or (SUBSTR(barcode, 2, 1) not between '0' and '9')
or (SUBSTR(barcode, 3, 1) not between '0' and '9')
Jul 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary | last post by:
Morning all, I have a form field called: Bsk01 How do I onBlur prompt the user to enter a ZERO as character one, if one is not already entered. At the same time, I would like to ensure at...
8
by: Mr. B | last post by:
In VB6, I had some code which 'forced' the first character of a string entered to be Capital. For example, if a person was entering their name (john doe)... the code would 'force' --- John Doe. ...
2
by: Greg Buckley | last post by:
I have come across an interesting problem. Let me first state that I am not a fluent ASP programmer. I am a network engineering trying to port an existing app. The app in question is currently...
0
by: jtocci | last post by:
I'm having a big problem with CREATE RULE...ON INSERT...INSERT INTO...SELECT...FROM...WHERE when I want to INSERT several (20~50) records based on a single INSERT to a view. Either I get a 'too...
2
by: D.Frangiskatos | last post by:
Hi, I have been working for a few months in project that deals raw sockets. However recently, and while trying to examine the contents of the buffer used in recvfrom i was a bit confused. The...
2
by: bmayer | last post by:
I am using a SqlDataSource to put data into a database from three TextBoxes. The problem is that only the first character from the TextBoxes is being inserted into the database. The code: ...
9
by: sovht | last post by:
System: Intel, Windows XP Pro, SP2 IDE: VC++ 6.0 Problem: *Very* simple program to create a MessageBox only ever displays the first character of the given string. I checked the spec for the...
3
bartonc
by: bartonc | last post by:
Is it possible to select a column of type INTEGER PRIMARY KEY without knowing its name? This also happens to be column zero in all my tables. I've played with lots of different syntaxes, to no avail....
1
by: Pheddy | last post by:
Hey everybody! I need a code to select all (*) from my databse (.mdb - microsoft access) where first letter i X.. how can I do this? Thanks. Frederik
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.