?
Solved

Select into tb.column from different tb.column

Posted on 2010-11-19
4
Medium Priority
?
230 Views
Last Modified: 2012-05-10
I have two tables, both contain employee_no and other column's, I need to 'copy' only the employee_no column into an existing tb, so that it can be updated with new information, how would I go about doing this?
0
Comment
Question by:JYLWest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34173158
You mean something like:

   INSERT INTO [Table2] ([employee_no])
       SELECT [employee_no] FROM [Table1]

?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34173178
I think you want to UPDATE with JOIN ...
see this article: http://www.experts-exchange.com/A_1517.html
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 1500 total points
ID: 34173266
Updates one table with info in another table joined on employee_no. ??

UPDATE a SET
   somecolumn = b.someothercolumn
FROM TableOne a
INNER JOIN TableTwo b ON a.employee_no = b.employee_no
0
 

Author Closing Comment

by:JYLWest
ID: 34831138
managed to come right but very close to where i needed to be.
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question