From 39acf4974160db6b5cd490dcaa9569c1d16e2930 Mon Sep 17 00:00:00 2001 From: yvesf Date: Mon, 15 Jun 2009 22:52:15 +0000 Subject: asd git-svn-id: http://xapek.org/svn/common/omegle@1137 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd --- abfragen.sql | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 abfragen.sql (limited to 'abfragen.sql') diff --git a/abfragen.sql b/abfragen.sql new file mode 100644 index 0000000..53ba62d --- /dev/null +++ b/abfragen.sql @@ -0,0 +1,20 @@ + +-- Ausdauernde + SELECT a.send_time - b.send_time AS "Dauer", date_trunc('day',a.send_time) + FROM ( SELECT MAX(send_time) AS send_time, from_ident + FROM omegle_messages + GROUP BY from_ident ) a + JOIN ( SELECT MIN(send_time) AS send_time, from_ident + FROM omegle_messages + GROUP BY from_ident ) b + ON a.from_ident = b.from_ident + WHERE a.send_time - b.send_time > interval '1 hour' +ORDER BY 1 DESC; + +-- Fleissigste + SELECT COUNT(*), from_ident, date_trunc('hour',MIN(send_time)) + FROM omegle_messages +GROUP BY from_ident + HAVING COUNT(*) > 10 +ORDER BY 1 DESC; + -- cgit v1.2.1