34,576
社区成员
发帖
与我相关
我的任务
分享
select a.orgid,a.secuid,a.stkcode,a.bsflag,cast(a.clearamt as int) mmje,cast(b.fundavl as int) kyye,cast(a.clearamt/5 as int) taxi,a.custid,a.custname,a.matchqty
from dlcg.run.dbo.orderrec a join dlcg.run.dbo.fundasset b on a.custid=b.custid
where a.clearamt<>0 and a.bsflag='0S' and a.secuid+a.stkcode in
(select fwgddm+fwzqdm collate Chinese_PRC_BIN from v_xsgdk)
--please have a try
select a.orgid,a.secuid,a.stkcode,a.bsflag,cast(a.clearamt as int) mmje,cast(b.fundavl as int) kyye,cast(a.clearamt/5 as int) taxi,a.custid,a.custname,a.matchqty
from dlcg.run.dbo.orderrec a join dlcg.run.dbo.fundasset b on a.custid=b.custid
join v_xsgdk v on a.secuid collate Chinese_PRC_BIN=v.fwgddm and a.stkcode collate Chinese_PRC_BIN=v.fwzqdm
where a.clearamt<>0 and a.bsflag='0S'
--try
select a.orgid,
a.secuid,
a.stkcode,
a.bsflag,
cast(a.clearamt as int) mmje,
cast(b.fundavl as int) kyye,
cast(a.clearamt/5 as int) taxi,
a.custid,
a.custname,
a.matchqty
from dlcg.run.dbo.orderrec a,dlcg.run.dbo.fundasset b,v_xsgdk c
where a.clearamt<>0 and a.bsflag='0S' and a.custid=b.custid
and (a.secuid+a.stkcode=c.fwgddm+c.fwzqdm collate Chinese_PRC_BIN)