Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
notes4we
Yak Posting Veteran
90 Posts |
Posted - 2009-02-25 : 09:25:28
|
Hello Friends,I have a table A as follows:ID Name1 A2 B3 C4 DI have another table B as follows:ID Message Date JobStatus1 Good 01/01/2009 Completed2 Good 02/03/2009 Pending3 Poor 01/03/2009 Approved4 Good 02/02/2009 CompletedFrom the above two tables, I want to create a new table as follows:Name Message Date JobStatusA Good 01/01/2009 CompletedB Good 02/03/2009 PendingC Poor 01/03/2009 ApprovedD Good 02/02/2009 Completed Which means that I want to know if there is a way to write a SQL query that will help me to get the Names of the ID's by matching the ID's.To be more clear, in the new table that I will be creating, I want to see that if in table A, ID is 1, then it should check table B, ID and retrieve the name from it as A.So, in place of ID's 1, 2, 3 or 4, I want to see the names A, B, C or D.I would be here to answer any questions if I am unclear in my question above.Thanks,notes4we |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2009-02-25 : 09:28:14
|
yes, look at INNER JOIN in Books Online, surely after over 50 posts, you should understand simple joins?!? |
 |
|
|
|
|
|
|