I Have a table as follows:
POOLID TIME
101 1
101 2
101 1
102 1
102 2
This table gets populated with data from some other source which is not in my control.
This table should have unique combination of (PoolID,Time) i.e a poolid, time combination should repeat only once in the data. I do not want to implement this in table design logic but want a query that gives me as output all pool ids for which poolid,time combination is not unqiue.
So the output should be 101 in this case (PoolID -101 , Time- 1 combination is not unique i.e it is repeating twice in the data)
I have the following query which does this but it works fine in oracle and not in MS ACCESS. Kindly help
select table3.poolid as poolid from
(select poolid as poolid,count(*) as frequency1 from temp group by poolid order by poolid asc) table3
,(select poolid as poolid ,count(*) as frequency2 from
(select distinct poolid as poolid, time as time1 from temp order by poolid asc) table1 group by poolid order by poolid asc) table2
where
table3.poolid = table2.poolid
and
table3.frequency1!=table2.frequency2