select SUM(amount) sum from( select distinct billno, amount from bill) as distincted
SELECT SUM(Amount) FROM (SELECT DISTINCT BillNo FROM [TableName]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)