Foxtable(狐表)用户栏目专家坐堂 → sql报错


  共有2019人关注过本帖树形打印复制链接

主题:sql报错

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110579 积分:562791 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/12/19 20:33:00 [显示全部帖子]

 as 后面的别名不需要大括号。另外位置不对

se lect * from (Sel ect [ITEM_ID] As [主件ID],[ITEM_CODE] As [主件品号],[ITEM_NAME] As [主件品名],[SHORTCUT] As [主件材质],[ITEM_SPECIFICATION] As [主件规格],[DRAWING_NO] As [主件图号],[BOM_ID] From {BOM} Inner JOIN {ITEM} ON {ITEM}.[ITEM_BUSINESS_ID] = {BOM}.[ITEM_ID]) as a inner join (Se lect [SOURCE_ID_ROid],[ITEM_CODE] As [元件品号],[ITEM_NAME]As [元件品名],[SHORTCUT] As [元件材质],[ITEM_SPECIFICATION]As [元件规格],[DRAWING_NO]As [元件图号],[BOM_ID] From {BOM_D} Inner JOIN {ITEM} ON {ITEM}.[ITEM_BUSINESS_ID] = {BOM_D}.[SOURCE_ID_ROid]) as b on A.[BOM_ID] =B.[BOM_ID] left join (Sel ect round(avg([UNIT_COST]),2) As [采购均价],[ITEM_ID] From {INV_UNIT_COST} Inner JOIN {ITEM} ON {ITEM}.[ITEM_BUSINESS_ID] = {INV_UNIT_COST}.[ITEM_ID] Where datediff(year,[ACCOUNT_YEAR],getdate())=0 Group By [ITEM_ID]) as c on C.[ITEM_ID]= B.[[SOURCE_ID_ROid]


 回到顶部