May-08-2017, 07:56 PM
Its great if someone can help me to reproduce the below T-SQL join using panadas dataframe join.
SELECT * FROM [TEST].[dbo].[table] t1 join [TEST].[dbo].[table] t2 ON (t2.CrCode = t1.DrCode and t2.Amount <= t1.Amount) WHERE t1.Ref = 'Deduct' or t1.Ref = 'Transfer' and t2.Ref = 'ADD' and t1.Ref != 'Transfer'Thanks for your interest