I have a query that queries two tables (including a self join on one of them) and returns a result set that almost (but not quite) gives me what I want , and was wondering if someone could give me some pointers. Rather than show the whole query (complex), I'll show the result set and describe what i want:
Pat: I think he goes for a count of unique rows instead of the unique rows alone.
You could use Count(*) with GROUP BY, or am I missing something? Even if he just wanted a count of the number of groups, he could create a virtual table using GROUP BY and then count the number of rows in that table, something like:
FROM (SELECT a.Efid, a.VID
FROM myTable AS a
GROUP BY a.Efid, a.VID) AS b