I want to get sum of TotAmount from unique SONumbers. So I used this code. But it gives me the error:
Every derived table must have its own alias
Please help me to solve this.
My code:
ResultSet rs = s.executeQuery ("SELECT TotAmount
From (SELECT Distinct SONumber From sale)
where DateTime between '" + FromDate + "
00:00:00" + "' AND '" + ToDate + " 00:00:00" + "' ");