I have following problem:
I want to count data in one table, count data in second table and compare countings in having clause, and display only that rows which have the same countings
Something like that:
SELECT bla
FROM T1 t1 JOIN T2 t2
ON t1.id = t2.id
HAVING COUNT(counted data from table1) = COUNT(counted data from table2)
Do you have any idea?
Cheers
Standard SQL:
Oracle SQL (because Oracle doesn’t like AS before table aliases):
You just have to decide where
blacomes from; I nominatedt1. I’m assuming that for any given value oft1.id, there is a single value oft1.bla. If there isn’t, then you need to explain much more clearly what you’re counting and where the various columns are, and what the keys of the tables are.Update: Apologies for not noticing the Oracle tag and giving invalid Oracle syntax.