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

Just want to have first name only

Greetings All,
Once again back to this forum.

I have got a problem and hope to get solution.

Senario..
I have a table called users, it has following fields
user_name firstname lastname
---------------- -------------- -------------
Parker Alan & Jenny Parker


I have exported data to user table and my user data is in user_name field
and first name field is blank

Want to Achieve: Parker Alan & Jenny which is in user_name field and I want to achieve only first name as Parker in firstname field using some update command(Just shown above )

How can I achieve this?
Your help would be greately appreciated
Samuel
Mar 28 '08 #1
4 1545
Just found a little way..

Did this way

update users set firstname=substr(user_name,1,7)

Above query got nearly correct result

Pearson
Allie

Some are like this
Bobsol L

Now my question in Bobsol L Now I want to remove white space and L charcter

Thanks
Mar 28 '08 #2
amitpatel66
2,367 Expert 2GB
Just found a little way..

Did this way

update users set firstname=substr(user_name,1,7)

Above query got nearly correct result

Pearson
Allie

Some are like this
Bobsol L

Now my question in Bobsol L Now I want to remove white space and L charcter

Thanks
Try This:

Expand|Select|Wrap|Line Numbers
  1.  
  2. update users set firstname=substr(user_name,1,INSTR(first_name,' ')-1);
  3.  
  4.  
Mar 28 '08 #3
Hi,
Thank you so much for your response. That has helped me.


Once again thank you for your kind help
Samuel
Mar 31 '08 #4
amitpatel66
2,367 Expert 2GB
Hi,
Thank you so much for your response. That has helped me.


Once again thank you for your kind help
Samuel
You are Welcome :)

Do post back in case of any issues.

Amit
Mar 31 '08 #5

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

Similar topics

10
by: Norman Bird | last post by:
I have a form i will use to register new people and when I click the submit button, the form just shows itself. It is supposed to show a message showing field errors if you leave fields blank etc....
11
by: Ville Vainio | last post by:
It might just be that @decorator might not be all that bad. When you look at code that uses it it's not that ugly after all. A lot of the furor about this is probably because it happened so...
38
by: Kevin Smith | last post by:
For what it's worth, I wrote the original PEP 318. I probably wasn't qualified, but I just wanted a nice simple way to declare class methods without having to repeat the function name. After...
16
by: John Rivers | last post by:
http://www.15seconds.com/Issue/030812.htm?voteresult=1 poor guy worked his heart out, just to make a page control and then they published it ha ha ha ha ha to "help" others
4
by: aj | last post by:
DB2 LUW v8.2 FP 14 RHAS 2.1 I have a DB2 online DB backup that was done w/ the INCLUDE LOGS option. I am interested in restoring that backup, and rolling forward ONLY the logs contained in the...
31
by: Sam of California | last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing of the source file"? I responded to that comment by saying that the preprocessor is not just a pass. It processes...
11
by: dolphin | last post by:
Hi All! I have a question that how to call a function just using a string. For example There is a .cpp file named a.cpp.There are some functions::fun1() fun2() fun3(). I have another fucntion...
2
klarae99
by: klarae99 | last post by:
Hello, I am working in Access 2003 to create a database to record information about an annual fundraiser. I was hoping someone could review my table structure and make sure that it is normalized...
6
by: D'Arcy J.M. Cain | last post by:
I am trying to create a utility module that only loads functions when they are first called rather than loading everything. I have a bunch of files in my utility directory with individual methods...
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: 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...
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
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.