SQL select & Insert

Goomba79

Registered User.
Local time
Today, 21:11
Joined
Jul 25, 2012
Messages
18
Hello!

I am pretty new to SQL so I imagine my problem is extremely simple!

What I am trying to do is select values in the columns Fname and Sname and insert them in to the column Uname Where the selected empNo emp = empno.
i'm hoping this will run through every entry in my table.

my query so for looks like this...

Select SRuser.Fname, SRuser.Sname As Myname, SRUser.EmpNo as Emp
Insert Myname Into SRuser (Uname)
Where EmpNo = Emp;

If anyone could give me any pointers to how to do this I would greatly appreciate it!

Thanks in advance,

Iain
 
Actually this sounds more like an UPDATE than an INSERT. You are not creating new records in SRUSER are you? You are simply updating a field of existing rows, right?

If so, check out this for UPDATE query help: http://www.w3schools.com/sql/sql_update.asp

If you still have trouble, post some sample data--before and after your query runs.
 

Users who are viewing this thread

Back
Top Bottom