I have this Cash Table created in SQL Server In which i need to Know that what is the Type of Currency Note, and what is the No of Currecny and total Number.
1 = Amount Came
2 = Amount Gone
I am expecting the result by grouping the SQL Query. means if i have 1000 currency and Total Number of Currency Note is 11 [Considered as Came/Given is “1”] which makes it 11000 as total
Same way i have a currency note of 20 [which is 1 In and 1 Given] so it should not be in the desired output as has No matching or i dont have any Notes of 20. as i have Got one Note of 20 and given back 20
Expected Output is
Currency No of Currency Total
1000 -- 11 - 11000
500 -- 1 -- 500
100 -- 1 - 100
50 -- 1 - 50

1 Answer