Temporary Table with having count
Posted by:
F K
Date: November 01, 2024 04:13AM
Hello everyone,
I hope you can help me.
I have a table with measurement data. Each measurement has its own ID and dozens of measurements are taken every day.
I have used HAVING COUNT to display which days have at least 600 measurements, because I only need these days.
The syntax for this is as follows:
select
count(id) as TotalIdPerDay,
gmtdate as Date
from
table
group by
gmtdate
having
count(*) > 600
order by
count(id) desc
Now I would like to transfer these results to a temporary table.
Can this be done with a single query?
I did it manually, which is very time-consuming (the date is always a day that has more than 600 measurements:
create temporary table
temp_table
select
*
from
data
where
Date = '2024-10-13'
or
Date = '2024-10-23'
or
Date = '2024-10-01'
or
Date = '2024-10-06'
or
Date = '2024-10-20'
or
Date = '2024-10-21'
or
Date = '2024-10-02'
or
Date = '2024-10-11'
or
Date = '2024-10-15'
or
Date = '2024-10-25'
or
Date = '2024-10-08'
or
Date = '2024-10-09'
or
Date = '2024-10-03'
or
Date = '2024-10-07'
or
Date = '2024-10-04'
or
Date = '2024-10-27'
or
Date = '2024-09-30'
;
I would like this to be easier. So preferably everything with just one query.
Do you have any ideas?
Thank you very much
Subject
Written By
Posted
Temporary Table with having count
November 01, 2024 04:13AM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.