Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 1st, 2007, 03:52 PM
Registered User
 
Join Date: Sep 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default String manipulation

I have a column of data that has values such as this (with spaces within):

a1 234
ab12 ddd
a11 12d
s4 9dd

I want to be able to re-select this column of data and split it so that the first part of the data (before the space) is separate from the second part of the data (after the space). So "A1 234" would be "A1" Column1 and "234" Column2, "Ab12 ddd" would be "Ab12" Column1 and "ddd" Column2 etc....

I'm thinking along the lines of using the Left and Substring functions but not sure how best to implement them.

Thanks


Reply With Quote
  #2 (permalink)  
Old October 1st, 2007, 04:24 PM
Registered User
 
Join Date: Sep 2007
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ahhh - just worked out my own soln along the lines of:

select left(columnname,charindex(space(1), columnname))
from mytable

...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String manipulation Franco1 Visual Basic 2005 Basics 1 July 16th, 2008 12:53 PM
String manipulation pcase XSLT 5 June 14th, 2007 10:32 AM
String manipulation YoungLuke C# 4 May 4th, 2007 01:46 AM
String Manipulation twsinc Access 3 February 23rd, 2004 09:57 AM
String Manipulation Ben Access VBA 2 July 8th, 2003 05:53 AM



All times are GMT -4. The time now is 12:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.