I have an Oracle script that returns a list of users along with a total:
SELECT fname || ' ' || lname) user,
WHERE submitted = 'Y'
and trunc(date) between date1 and date2
group by fname || ' ' || lname)
order by fname || ' ' || lname)
I'm using VB.Net to tie these results into a asp:repeater. However, I need mutliple totals that come from different tables with different WHERE clauses for all users in one sql statement.
In MySql, I could do something like this:
(SELECT count(*) FROM tbl WHERE whatever gets total1) AS total1,
(SELECT count(*) FROM tbl WHERE whatever gets total2) AS total2,
(SELECT count(*) FROM tbl WHERE whatever gets total3) AS total3,
WHERE dept = deptid
AND date BETWEEN date1 AND date2
ORDER BY first_name
GROUP BY blah blah blah
I'm having trouble doing something like the above in Oracle.
Thanks in advance.