SQL92标准与SQL99标准查询
2014-04-11 22:36
603 查看
--The SQL92 standards查询金蝶K3销售出库单
select
a.fbillno, --单据编号
a.fdate, --单据日期
a.fcheckdate, --审核日期
e.fname, --业务员
f.fname, --业务部
d.fname, --客户
c.fnumber, --物料编码
c.fname, --物料名称
c.fmodel, --规格型号
b.forderbillno, --销售订单号
b.fauxqty, --实发数量
b.fqty, --基本单位数量
b.fconsignprice, --销售单价
b.fconsignamount --销售金额
from icstockbill a, --出入库表头
icstockbillentry b, --出入库表体
t_icitem c, --物料表
t_organization d, --客户表
t_emp e, --职员表
t_department f --部门表
where a.ftrantype = 21 --21:销售出库
and datediff(m,a.fdate,'20140311')=0 --时间为20140311同一天的单据
and a.finterid = b.finterid
and b.fitemid = c.fitemid
and a.fsupplyid = d.fitemid
and a.fempid = e.fitemid
and a.fdeptid = f.fitemid
--The SQL99 standards查询金蝶K3销售出库单
select
a.fbillno, --单据编号
a.fdate, --单据日期
a.fcheckdate, --审核日期
e.fname, --业务员
f.fname, --业务部
d.fname, --客户
c.fnumber, --物料编码
c.fname, --物料名称
c.fmodel, --规格型号
b.forderbillno, --销售订单号
b.fauxqty, --实发数量
b.fqty, --基本单位数量
b.fconsignprice, --销售单价
b.fconsignamount --销售金额
from icstockbill a join icstockbillentry b
on a.finterid = b.finterid
join t_icitem c
on b.fitemid = c.fitemid
join t_organization d
on a.fsupplyid = d.fitemid
join t_emp e
on a.fempid = e.fitemid
join t_department f
on a.fdeptid = f.fitemid
where a.ftrantype = 21 --21:销售出库
select
a.fbillno, --单据编号
a.fdate, --单据日期
a.fcheckdate, --审核日期
e.fname, --业务员
f.fname, --业务部
d.fname, --客户
c.fnumber, --物料编码
c.fname, --物料名称
c.fmodel, --规格型号
b.forderbillno, --销售订单号
b.fauxqty, --实发数量
b.fqty, --基本单位数量
b.fconsignprice, --销售单价
b.fconsignamount --销售金额
from icstockbill a, --出入库表头
icstockbillentry b, --出入库表体
t_icitem c, --物料表
t_organization d, --客户表
t_emp e, --职员表
t_department f --部门表
where a.ftrantype = 21 --21:销售出库
and datediff(m,a.fdate,'20140311')=0 --时间为20140311同一天的单据
and a.finterid = b.finterid
and b.fitemid = c.fitemid
and a.fsupplyid = d.fitemid
and a.fempid = e.fitemid
and a.fdeptid = f.fitemid
--The SQL99 standards查询金蝶K3销售出库单
select
a.fbillno, --单据编号
a.fdate, --单据日期
a.fcheckdate, --审核日期
e.fname, --业务员
f.fname, --业务部
d.fname, --客户
c.fnumber, --物料编码
c.fname, --物料名称
c.fmodel, --规格型号
b.forderbillno, --销售订单号
b.fauxqty, --实发数量
b.fqty, --基本单位数量
b.fconsignprice, --销售单价
b.fconsignamount --销售金额
from icstockbill a join icstockbillentry b
on a.finterid = b.finterid
join t_icitem c
on b.fitemid = c.fitemid
join t_organization d
on a.fsupplyid = d.fitemid
join t_emp e
on a.fempid = e.fitemid
join t_department f
on a.fdeptid = f.fitemid
where a.ftrantype = 21 --21:销售出库
相关文章推荐
- Oracle8i 与 Oracle 9i SQL语法区别 (sql86与sql92标准的区别)
- 关于SQL92标准和Sybase,SQLServer2000,Oracle的数据类型对比关系
- SQL92标准语句Mycat支持测试 (基于Oracle和MySQL数据库)与下载地址
- 关于SQL92标准和Sybase,SQLServer2000,Oracle的数据类型对比关系
- SQL92标准
- SQL92标准
- 信息技术安全标准目录
- PKCS系列标准
- 第一章 用标准I/O函数将标准输入复制到标准输出 1-3
- java web 的标准目录结构(zz)
- 【C++】从标准输入中读取字符串
- 西门子涉嫌商业贿赂是外企双重标准之祸
- C# 串口操作系列(1) -- 入门篇,一个标准的,简陋的串口例子。
- 地图常用标准功能
- eclipse mars对C++11标准的支持
- C语言(Head First C)-4_1:创建小工具:标准输入输出和重定向
- 鼠标拖动层, W3C标准,兼容IE6 & Firefox
- [收藏]POSIX标准
- Win SDK 标准程序
- Java 流异常的标准处理(转载)