473,386 Members | 1,819 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.

Parse field with underscore character

1
If i have field in table which include value such as (111_556_ _ _555_88). how can i get each part of the field by sql?
Jul 18 '07 #1
1 1630
mwasif
802 Expert 512MB
If the pattern is the same use only SUBSTRING() as i did below
Expand|Select|Wrap|Line Numbers
  1. SELECT SUBSTRING('111_556_ _ _555_88', 1,3)  AS first_part,
  2. SUBSTRING('111_556_ _ _555_88', 5,3) AS second_part
But if the digits are of variable length between underscores then use LOCATE() with SUBSTRING(). List of all mysql string functions can be found here http://dev.mysql.com/doc/refman/5.0/...functions.html.
Jul 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ken Bush | last post by:
How can I write an update query that removes part of a field? Like if I have a field with values such as 8/3/68 (a birthday obviously) and I need to put values in a new column but I need...
11
by: hoopsho | last post by:
Hi Everyone, I am trying to write a program that does a few things very fast and with efficient use of memory... a) I need to parse a space-delimited file that is really large, upwards fo a...
38
by: Astra | last post by:
Hi All Could somebody please confirm that if I change my JS expression test from: if (!(/^*$/.test(document.form1.fred.value))) to if (!(/^*$/.test(document.form1.fred.value)))
1
by: Kanon | last post by:
Hi, I hope this is the proper newsgroup for this kind of question. I have just started to learn about RSS and made my first feed: http://www.herbaloutfitters.com/pbw/alpha/rss/1-1.xml Some...
1
by: Barkster | last post by:
I have a field that contains an underscore. How can I do a query for the underscore since I just found that underscore really doesn't find underscore it is a wildcard in mysql. I need to be able...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
2
by: scott | last post by:
Is there a way to make the underscore Character display in a browser? I've tried several different fonts but the "_" character will not display.
1
by: Dan Somdahl | last post by:
Hi, I am new to ASP but have what should be a fairly simple task that I can't figure out. I need to parse a string from a single, semi-colon delimited, 60 character field (el_text) in a recordset...
1
by: Dan Somdahl | last post by:
Hi, I am new to ASP but have what should be a fairly simple task that I can't figure out. I need to parse a string from a single, semi-colon delimited, 60 character field (el_text) in a recordset...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.