|
 |
asp_web_howto thread: sql syntax problem
Message #1 by "taherm@f... on Tue, 18 Sep 2001 12:51:55
|
|
i have 2 tables...
scenario
i have 2 tables namely categories and product
categories fields are
1)catid
2)catname
product table fields are
1) catid
2) catname
3) productname
in the category table all the data is feeded in. thats fine!!!
in the product table only catid and product name is feeded in.
i need to design a dts to check the catid of product table in categories
table and pull the relevant catname from categories table and place it in
the product table.
plz let me knwo of how to write an update query in the product table.
update product
set product.catname = ---dont know
where (select catname.category,catid.category,catname.product,catid.product
from Category JOIN product ON Category.CatID = product.CatID)
the above sql statement is fully wrong, but this is just a logic whih i
ahve in my mind.
can anyone help me!!!
any suggestions.... will be greatly appreciated
thanks
Regards
Message #2 by "John P. Miller" <jpmiller@a...> on Tue, 18 Sep 2001 09:01:07 -0400
|
|
update product set product.catname = categories.catname where product.catid
= categories.catid
Should Work?
John Miller
jpmiller@a...
----- Original Message -----
From: <taherm@f...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Tuesday, September 18, 2001 12:51 PM
Subject: [asp_web_howto] sql syntax problem
>
> i have 2 tables...
> scenario
> i have 2 tables namely categories and product
> categories fields are
> 1)catid
> 2)catname
>
> product table fields are
> 1) catid
> 2) catname
> 3) productname
>
> in the category table all the data is feeded in. thats fine!!!
>
> in the product table only catid and product name is feeded in.
>
> i need to design a dts to check the catid of product table in categories
> table and pull the relevant catname from categories table and place it in
> the product table.
> plz let me knwo of how to write an update query in the product table.
>
> update product
> set product.catname = ---dont know
>
> where (select
catname.category,catid.category,catname.product,catid.product
> from Category JOIN product ON Category.CatID = product.CatID)
>
>
> the above sql statement is fully wrong, but this is just a logic whih i
> ahve in my mind.
>
> can anyone help me!!!
> any suggestions.... will be greatly appreciated
>
> thanks
> Regards
|
|
 |