最近拜读一位前辈的blog,感触良多,也间接增加了很多经历。
前辈有云,要立即行动,吾又思量,临渊羡鱼,不如退而结网,故写此篇,开始自己的blog.
也没准备好什么,简单说下自已最近学到的。
在access中也可以用到一些比较高级的语法(虽然写起来较sqlserver麻烦):
1.不存在时插入
INSERT INTO T_INV ( lccode,spcode,Qty,Cost,xssl )
SELECT '001' AS 表达式1,T_POD.spID,0 AS 表达式2,0 AS 表达式3,0 AS 表达式4
FROM T_POD
WHERE (((T_POD.[NO])='PO201004280001') AND (( not Exists (select * from T_INV where T_INV.lccode = '001' and T_INV.spcode = T_POD.SPID
))=true));
2.isnull的变体
SELECT V_SPXX_LOCATION.T_SPXX.code AS 品号,V_SPXX_LOCATION.T_LOCATION.code AS 仓库编号,iif(isnull(T_Inv.Qty),T_Inv.Qty) AS 库存数量,V_SPXX_LOCATION.productname AS 品名,V_SPXX_LOCATION.name AS 仓库名称,*
FROM V_SPXX_LOCATION left JOIN T_Inv ON (V_SPXX_LOCATION.T_LOCATION.code=T_Inv.lccode) AND (V_SPXX_LOCATION.T_SPXX.code=T_Inv.spcode);
3. 带null 的筛选
SELECT T_Inv.*,V_sel_TakeIn.*FROM T_Inv left JOIN V_sel_TakeIn ON (T_Inv.lccode = V_sel_TakeIn.lccode) AND (T_Inv.spcode = V_sel_TakeIn.spcode)WHERE (((V_sel_TakeIn.lccode) Is Null));
总结以上是内存溢出为你收集整理的不想永远做旁观者,就立即行动~~全部内容,希望文章能够帮你解决不想永远做旁观者,就立即行动~~所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)