RE: Help with query

2014-06-06 Thread Ricardo Birmele
IT Security Operations • | | • [Microsoft Logo] From: Petter von Dolwitz (Hem) [mailto:petter.von.dolw...@gmail.com] Sent: Thursday, 5 June, 2014 01:33 To: user@hive.apache.org Subject: Re: Help with query I tried to answer this earlier. Maybe the mail got suck somewhere. I'll try

Re: Help with query

2014-06-05 Thread Petter von Dolwitz (Hem)
I tried to answer this earlier. Maybe the mail got suck somewhere. I'll try again. SELECT COUNT(DISTINCT ip) AS count, query_string FROM myTable GROUP BY query_string ORDER BY count DESC; This should give you one row per asked query. Rows are ordered by number of unique IPs that asked the query.

Re: Help with query

2014-06-03 Thread Nitin Pawar
can you put your example with sample data and expected result output? On Fri, May 30, 2014 at 4:59 AM, Software Dev wrote: > We have a table with user entered queries, their IP. How could we > write a query that will count and order queries by their count having > a unique IP count > X. For exa

Re: Help with Query

2014-05-31 Thread Petter von Dolwitz (Hem)
SELECT COUNT(DISTINCT ip) AS count, query_string FROM myTable GROUP BY query_string ORDER BY count DESC; This should give you one row per asked query. Rows are ordered by nummer of unique IPs that asked the query. Most popular first. Br, Petter Den 30 maj 2014 19:17 skrev "Software Dev" : > We h