您的位置:首页 > 数据库

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:销售出库
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  业务员 standards