我的这条sql语句错在哪里?

产品分类表 productclass
classid classname class_time

用户产品分类表user_roductclass
id classid classname userid (其中classid与productclass表中的classid外键)

现在用户产品分类表中id,classid,userid有数据,而classname没有数据,我想用sql语句从产品分类表中的classname值放到roductclass表的classname中
我的写法是:
update from user_productclass u set classname=(select classname from productclass pr where pr.classid=u.classid) where userid=15
不知道哪里错了

作者: wangsdong   发布时间: 2011-06-16

SQL code
update u set classname=(select classname from productclass pr where  
                                   pr.classid=u.classid)
from user_productclass u where userid=15

作者: ssp2009   发布时间: 2011-06-16

SQL code

update user_productclass
set classname=(select classname from productclass pr where pr.classid=u.classid)
from user_productclass u where userid=15


试试这样行不行?

作者: maco_wang   发布时间: 2011-06-16