samedi 25 avril 2015

oracle sql to get min timestamp when the count of results large than a number


in order to improve the performance, I need a sql to implement the following requirement.

If there is a table and has the following column:

id timestamp value

How can I get the min timestamp when the count of the result > 100000 ?

for example if the timestamp is :t1, then the following sql result--count(*) will > 100000

select count(*) from table where  timestamp < :t1


Aucun commentaire:

Enregistrer un commentaire