hmm, you means fill the second temporary table first and then after populating second temp table value of second temp table into original table base on condition .
e.g
if(condition==true)
{
//fill data in orignal table
}
else
{
//=======fill data in temp table
}
//==========now after filling all table if condition is false===
while select * from table group by columns where condition
{
//insert temp data to orignal data
}
can we change query object at run time ?
can we filter directly in-memory table after populating?
like
SELECT AccountNum, AmountCurrencyCredit, AmountCurrencyDebit, ChequeDate,ChequeNum,Credit,CurrencyCode,
Debit,sum(Difference),Fund999,InvoiceDate,InvoiceDesc,InvoiceNum,Name,Reversed,
SettledDate,SettledVoucher,TraceNum,TransDate,Txt,Voucher
from vendTransListTmp
group by AccountNum, AmountCurrencyCredit, AmountCurrencyDebit, ChequeDate,ChequeNum,Credit,CurrencyCode,
Debit,Fund999,InvoiceDate,InvoiceDesc,InvoiceNum,Name,Reversed,
SettledDate,SettledVoucher,TraceNum,TransDate,Txt,Voucher
where vendTransListTmp.Difference==0.00;