📄 sql.sql
字号:
use Finance;
go
begin transaction;
declare @b bit;
execute AccountCodeExist '000001', @b output;
print @b;
select * from AccountView where (Kode like '13%');
select * from AreaView;
declare @n bit;
execute AreaQuery 0, '00', 'hasgdjashgd', @n output;
print @n;
MainTransaction
select * from TransactionDetail;
print dbo.MutasiString('H');
print dbo.PayMethodString(4);
select * from TransactionView
where
(year(TanggalEntry) = 2006) and (month(TanggalEntry) = 9)
execute TransactionViewDetail '01.00.01.001';
TransactionView
execute AccountReport '144111', '2005-01-31', '2009-12-31';
execute TransactionListReport 2006, 9
declare @n bit;
set @n = 1;
print cast(@n as varchar(10));
TransactionDetailQuery
declare @n varchar(20);
--execute AccountLabaRugiDetail '611111', '2006-09-01', '2006-09-30', @n output;
execute AccountTotalDetail '611111', 2006, 9, @n output;
print @n;
select
ac.Kode as [Kode], ac.NamaAccount, mt.TanggalEntry as [TanggalEntry],
case t.Mutasi when 0 then t.Jumlah else 0 end as [Debet],
case t.Mutasi when 1 then t.Jumlah else 0 end as [Kredit]
from Account as [ac]
right join TransactionDetail as [t] on (ac.Kode = t.IdAccount)
inner join MainTransaction as [mt] on (t.IdMainTrans = mt.NoBukti)
select
*,
case isnull(t.Mutasi, 0) when 0 then isnull(t.Jumlah, 0) else 0 end as [Debet],
case isnull(t.Mutasi, 0) when 1 then isnull(t.Jumlah, 0) else 0 end as [Kredit]
from Account as ac
left join TransactionDetail as t on (t.IdAccount = ac.Kode)
left join MainTransaction as mt on (mt.NoBukti = t.IdMainTrans)
where
(Kode not like '%0');
select
*,
isnull((case t.Mutasi when 0 then t.Jumlah else 0 end), 0) as [Debet],
isnull((case t.Mutasi when 1 then t.Jumlah else 0 end), 0) as [Kredit]
from Account as ac
left join TransactionDetail as t on (t.IdAccount = ac.Kode)
left join MainTransaction as mt on (mt.NoBukti = t.IdMainTrans)
where
(Kode not like '%0');
where
(year(mt.TanggalEntry) = 2006) and (month(mt.TanggalEntry) = 9)
rollback;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -