以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- sql报错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=111297) |
-- 作者:home8225 -- 发布时间:2017/12/19 19:15:00 -- sql报错 提示AS附近有语法错误*3,求助。。。。。。 |
-- 作者:有点蓝 -- 发布时间: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] |
-- 作者:home8225 -- 发布时间:2017/12/20 10:30:00 -- 谢谢~! |
-- 作者:home8225 -- 发布时间:2017/12/20 10:44:00 -- 全面报错???提示修改了只读数据....... |
-- 作者:有点甜 -- 发布时间:2017/12/20 10:49:00 -- 试试,去掉提示。
Dim dt = DataTables("表A").basetable |
-- 作者:home8225 -- 发布时间:2017/12/20 11:35:00 -- 谢谢,已经解决了,是sql加载列有问题 |