WITH table AS及其他
来源:互联网 发布:梦里花落知多少闻婧被 编辑:程序博客网 时间:2024/05/18 00:00
WITH table AS 临时表使用方法
SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOIF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[v_Order_Production_Scheduling]'))BEGIN DROP VIEW [dbo].v_Order_Production_Scheduling;ENDGO-- =============================================-- =============================================CREATE view [dbo].v_Order_Production_Scheduling AS WITH tb AS (SELECT VBELN, POSNR, ETENR, WMENG, EDATU, VRKME, WERKS, o.new_number as o_number, od.new_number as od_number, sd.new_number as sd_shippingline, sd.new_schedulingdetailsId as sd_schedulingdetailsId FROM PRODUCTION_SCHEDULING as ps LEFT JOIN dbo.new_order as o ON ps.VBELN = o.new_sapnumber LEFT JOIN dbo.new_orderdetails as od ON ps.POSNR = od.new_sapnumber AND o.new_orderId = od.new_orderId LEFT JOIN dbo.new_schedulingdetails as sd ON ps.ETENR = sd.new_number AND od.new_orderdetailsId = sd.new_orderdetailsid )SELECT VBELN, POSNR, ETENR, WMENG, EDATU, VRKME, WERKS, o_number, od_number, sd_shippingline, sd_schedulingdetailsId, '更新' AS describe FROM tb WHERE tb.sd_schedulingdetailsId IS NOT NULL UNION ALLSELECT VBELN, POSNR, ETENR, WMENG, EDATU, VRKME, WERKS, o_number, od_number, sd_shippingline, sd_schedulingdetailsId, '创建' AS describe FROM tb WHERE tb.o_number IS NOT NULL AND tb.od_number IS NOT NULL AND ETENR IS NOT NULLAND tb.sd_schedulingdetailsId IS NULL
两个对象都没有判空处理
如果前一对象为NULL,结果怎么样?
如果后一对象为NULL,结果怎么样?
schedulingdetails.Attributes["new_planline"].ToString() != viewlist.Tables[0].Rows[i]["ETENR"].ToString()
试验如下
string a = null;string b = null;string c = "c";string d = "d";Console.WriteLine(a != c);Console.WriteLine(c != a);Console.WriteLine(a != b);Console.WriteLine(c != d);
选项集赋值
schedulingdetails.Attributes["new_factory"] = new OptionSetValue(int.Parse(viewlist.Tables[0].Rows[i]["WERKS"].ToString()));
阅读全文
0 0
- WITH table AS及其他
- 关于oracle with table as的用法
- oracle中with table as临时表
- oracle with table as的用法整理
- ABAP-Send email with data of internal table as attachment
- oracle with table as 创建临时表的用法示例
- 关于oracle with table as 创建临时表
- 关于oracle with table as 创建临时表的用法示例以及使用with as 的优点
- with as
- with as
- with as
- WITH AS
- with...as...
- WITH AS
- with...as
- WITH AS
- 关于with as 作为查询片段的使用和与临时表#Table的比较
- create table as......
- iOS 实现颜色渐变
- Math、Date对象
- 【Python笔记】编码一个generator实现杨辉三角
- Variational Autoencoder: Basic Concept
- 滤波器的延时计算问题
- WITH table AS及其他
- 交错序列
- 【分层实验框架】阿里妈妈大规模在线分层实验实践
- java获取网页的内容(以String形式储存)
- python--leetcode500. Keyboard Row
- Jerry's Tom
- 9-25NOIP模拟赛总结
- 原生的js选择器
- 由setTimeout引出的事件循环机制