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 |
|
deanfp
Starting Member
26 Posts |
Posted - 2012-03-27 : 06:08:05
|
| HiWonder if someone can help. I have two tables that I am trying to add a column from table 2 to table 1.Product table contains all products and has a column called ProductID. ProductCategory contains the same ProductID but has a column StoreID that I want to show against a SKU value in Table 1.This I thought would work but does not seem to. Any ideas where I am going wrong?SELECT ProductID, SKU FROM ProductLEFT JOIN StoreID FROM ProductCategoryON Product.ProductID = ProductCategory.ProductIDThanks! |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-03-27 : 06:15:15
|
select t1.ProductID, t1.SKU, t2.StoreIDfrom Product as t1left join ProductCategory as t2 on t2.ProductID = t1.ProductID No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
deanfp
Starting Member
26 Posts |
Posted - 2012-03-27 : 06:15:45
|
| It's ok managed to figure it out |
 |
|
|
|
|
|