SELECT * from ContractBalanceTX cbh
where 1 = 1
And ContractBalanceProcessesId IN (select list FROM @contractbalanceprocess)
AND ContractId IN (select list from @your_list) --(1053, 1283)
--or cbh.ContractBalanceTXId IN (321909)
ORDER BY cbh.ContractId, cbh.ProcessOrder
I think I should always take the alias of the first from (cbh) or a way to force the name
Some way?
Thanks