473,487 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Move some part of data from one column to another

3 New Member
I have a column (StudentName) in my database table which has the students full name (both Surname and FirstName). But it is arranged such that the surname comes first.

Now, my problem is I want to move only the surname to a different column called 'Surname'.

How do I do it such that it will start selecting from the first character and stops once it meets the space, and then use it to update the 'Surname' column?

Thank you for your cooperation.


Becks.
Jan 20 '15 #1
2 1476
Luuk
1,047 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. SELECT substr(StudentName, 1, LOCATE(' ',StudentName)-1) AS Surname.......
see: this for more info
Jan 21 '15 #2
becks
3 New Member
Hi Luuk,

Thanks so much.

The code has work perfectly.

Good Job done.
Jan 23 '15 #3

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

Similar topics

3
2898
by: Baby Blue | last post by:
I have 2 codes below to grap data from another site. I use them to get the data from one News site. However, when I click on some link inside (such as :...
19
2370
by: Caesar | last post by:
Hi, I'm wondering if anyone here can point me in the right direction. My host does not provide php, and so I need to pull this data from another server that does support such scripting. Help?...
0
1294
by: Matthew Adams | last post by:
Hey, guys. I was wondering if anyone knew how to get data from another program's window, such as image or text data, or maybe just get a screenshot of the window. I was also wondering what is the...
0
1062
by: Marco | last post by:
Hi all, as I'll unfortunately always be a newbie, I need your help on this issue. I need to suggest to our customers a way to crate partitions on our tables, without having to add any new...
4
56165
by: alederer | last post by:
Hallo! I need to convert the values of a varchar (..) for bit data column to a string which can be stored in a normal varchar column (with additional information). Is there a function in db2...
9
1906
by: Hi5 | last post by:
Hi, I have designed a databasewhich is now able to store all data from my client's Excel sheet.Now I am looking for a good way to move their data into this Db. If I want to do this myself will...
5
11781
by: Tim | last post by:
Hi, I am trying to move a datacolumn in a datatable. What I have tried so far is to create a new datacolumn set it equal to the one I want to remove and then remove it, add another column and...
1
9894
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
6
3826
by: NarutoFanatic | last post by:
Hi! I need help in MS ACCESS, I need to create a query that could move different rows into another column. More like concatenation but in a different column rather than in one column. Example: ...
1
1858
by: ncsthbell | last post by:
I am on MS Office 2007. How can I set the data column property on a form to allow a user to enter a data value in the column to perform a ‘find’ but not change the table data for the record that is...
0
7106
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
7137
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
7349
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...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4874
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.