20130427

来源:互联网 发布:python sys.agv 编辑:程序博客网 时间:2024/06/06 01:05

select * from sf_bt where YEAR='2012' and cost != 0  and section=cost order by housecode; --42


select a.housecode from sf_bt a,(select housecode from sf_detail where chargemonth='2012') b
where a.;

select housecode from sf_detail having count(housecode) > 1 and chargemonth='2012' group by housecode,chargemonth ;
select * from sf_bt where housecode = '0000-007-00-00-00';
select * from sf_detail where housecode = '0000-007-00-00-00';

select b.housecode from sf_detail a,sf_bt b
where a.housecode = b.housecode
and a.clustercoding = b.clustercoding
and a.chargemonth = '2012'
and b.year = '2012'
and a.putincbk != b.cost
order by b.housecode;

--一户一笔财拨    36
select distinct b.id,a.housecode,a.putincbk,b.cost from sf_detail a,sf_bt b
where a.housecode = b.housecode
and a.clustercoding = b.clustercoding
--and a.putincbk = b.cost
and b.year='2012'
and a.chargemonth = '2012'
and b.housecode = '0000-066-00-00-00';

select id,housecode,section,cost from sf_bt where housecode in  ('0000-066-00-00-00',
'0000-078-00-00-00',
'0000-080-00-00-00',
'0000-080-00-00-00',
'0000-081-00-00-05',
'0000-081-00-00-05',
'0000-081-00-00-05'
) and year = '2012' order by housecode;

select housecode,putincbk from sf_detail where housecode in ('0000-066-00-00-00',
'0000-078-00-00-00',
'0000-080-00-00-00',
'0000-080-00-00-00',
'0000-081-00-00-05',
'0000-081-00-00-05',
'0000-081-00-00-05'
) and chargemonth = '2012' order by housecode;

select * from sf_detail where housecode='0000-080-00-00-00';

select housecode,nowaccount from sf_imprest where housecode in  ('0000-066-00-00-00',
'0000-078-00-00-00',
'0000-080-00-00-00',
'0000-080-00-00-00',
'0000-081-00-00-05',
'0000-081-00-00-05',
'0000-081-00-00-05'
) order by housecode;
select housecode,balance from sf_bill where housecode in  ('0000-066-00-00-00',
'0000-078-00-00-00',
'0000-080-00-00-00',
'0000-080-00-00-00',
'0000-081-00-00-05',
'0000-081-00-00-05',
'0000-081-00-00-05'
) order by housecode;

--一户多笔财拨
select distinct b.id,a.housecode,a.putincbk,b.b.cost,count(b.housecode) from sf_detail a,sf_bt b
where a.housecode(+) = b.housecode
and a.clustercoding(+) = b.clustercoding
--and a.putincbk = b.cost
group by b.id, a.housecode, a.putincbk, b.b.cost;

select * from sf_bt where housecode='6011-001-X0-02-36';

select * from sf_bill aa,sf_bt bb
where aa.housecode = bb.housecode
and aa.clustercoding = bb.clustercoding
and aa.balance = bb.cost;

select * from sf_imprest;

 

原创粉丝点击