473,396 Members | 1,933 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,396 software developers and data experts.

Splitting 1 column into 2

Pretty basic but I cannot figure it out.

Column:
FULLNAME (lname, fname)

Needs to be

FNAME
LNAME

Should split at the comman. I already have all the columns created; just
need to SQL command to make it happen. Thanks!!

*** Sent via Developersdex http://www.developersdex.com ***
Aug 12 '05 #1
2 1221
On Fri, 12 Aug 2005 12:49:28 -0700, Joey Martin <jo**@infosmiths.net> wrote:
Pretty basic but I cannot figure it out.

Column:
FULLNAME (lname, fname)

Needs to be

FNAME
LNAME

Should split at the comman. I already have all the columns created; just
need to SQL command to make it happen. Thanks!!

*** Sent via Developersdex http://www.developersdex.com ***


To do it at the database level is database specific, but in general:

select substr(FULLNAME,Instr(FULLNAME,",") +1) First_Name,substr(FULLNAME,1,Instr(FULLNAME,",") -1) Last_Name
from table
Your exact systax will vary but basically you need to find the position of the , and use the string functions of your
database to split it as needed.

Aug 12 '05 #2
Joey Martin wrote:
Pretty basic but I cannot figure it out.

Column:
FULLNAME (lname, fname)

Needs to be

FNAME
LNAME

Should split at the comman. I already have all the columns created;
just need to SQL command to make it happen. Thanks!!


More info please:
What database type and version are you using?
What do you want to do with the data once it is split?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 12 '05 #3

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

Similar topics

18
by: robsom | last post by:
Hi, I have a problem with a small python program I'm trying to write and I hope somebody may help me. I'm working on tables of this kind: CGA 1988 06 21 13 48 G500-050 D 509.62 J.. R1 1993 01...
3
by: Piet | last post by:
Hello, I have a very strange problem with regular expressions. The problem consists of analyzing the properties of columns of a MySQL database. When I request the column type, I get back a string...
1
by: Richard | last post by:
http://dynamicdrive.com/dynamicindex5/linkinfo.htm Using the above script, I have a plan whereby when the main link is active, two different content swaps take place. Column A shows the main...
0
by: Masa Ito | last post by:
I have large fixed width text files that I need to parse. I regex'd a file that defines the columns - so I now have a large arraylist of column headers and column widths. I can read a line of...
2
by: Matt | last post by:
Hi, I'm ridiculously new to Access (about a week!) so please be patient! My database is a record of British Standards. Each has a unique identifier. Some are split into parts. I would like...
2
by: shadow_ | last post by:
Hi i m new at C and trying to write a parser and a string class. Basicly program will read data from file and splits it into lines then lines to words. i used strtok function for splitting data to...
9
peeaurjee
by: peeaurjee | last post by:
Hi! I have a column in the Table of my database named 'Duration of Labour Contract' and inside this i have entered the data like that: 01/01/2006 - 31/12/2009 Now i need to split this...
1
by: MattB | last post by:
I have a DataTable of values I'm using in my asp.net (1.1) application. In one column, there is a composite value like "A,3". I'd like to know if there is a way I can add a couple of computed...
1
by: chris f | last post by:
I'm dynamically populating a Table control in ASP.NET 2. Each row has 4 columns but column #3 needs to be split into 3 rows and column #4 needs to be split into 4 rows. Each of these cells contains...
0
by: raj | last post by:
My Zope based application for a client has to generate annual audit reports with too wide tables of account-wise payment details. I turned to reportlab when HTML formatting became a headache for...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.