hi,
group by 1 means group by first output column
order by 2 means order by second output column ascending
Am 30.04.2011 19:00, schrieb Joel Reymont:
What is the meaning of
group by 1 order by 2
e.g. what to the numbers 1 and 2 stand for?
What would change if I do the follo
David Johnston wrote:
Given that you are actively implementing the code that uses the 1 and 2 I
don't see how it is that egregious. When generating calculated fields it is
cleaner than the alternative:
Select trunc(distance * 10.)/10., count(*)
From doc_ads
Group by (trunc(distance * 10.))
Or
Given that you are actively implementing the code that uses the 1 and 2 I
don't see how it is that egregious. When generating calculated fields it is
cleaner than the alternative:
Select trunc(distance * 10.)/10., count(*)
>From doc_ads
Group by (trunc(distance * 10.))
Order by (trunc(distance *
re: 1 and 2. They're horrible (imho) reference to the attributes of the
returned tuple. Or at best an exposure of the implementation. :)
Order by "2" if you want the most frequent (highest counts) of your
distances at the bottom of the output (or ordery by 2 desc) if you want
them at the top o
I think this should do what I want
select trunc(distance * 10.)/10., count(*)
from doc_ads
group by 1 order by 1
Thanks, Joel
--
- for hire: mac osx device driver ninja, kernel extensions and usb d
What is the meaning of
group by 1 order by 2
e.g. what to the numbers 1 and 2 stand for?
What would change if I do the following?
group by 1 order by 1
On Apr 30, 2011, at 5:48 PM, Thomas Markus wrote:
> Hi,
>
> try something like this:
>
> select
>trunc(random(
Thank you Thomas!
Is there a way for the code below to determine the number of rows in the table
and use it?
Thanks, Joel
On Apr 30, 2011, at 5:48 PM, Thomas Markus wrote:
> Hi,
>
> try something like this:
>
> select
>trunc(random() * 10.)/10.
>, count(*)
> from
>generat
Hi,
try something like this:
select
trunc(random() * 10.)/10.
, count(*)
from
generate_series(1,200)
group by 1 order by 2
regards
Thomas
Am 30.04.2011 18:37, schrieb Joel Reymont:
I have a column of 2 million float values from 0 to 1.
I would like to figure out how many valu
I have a column of 2 million float values from 0 to 1.
I would like to figure out how many values fit into buckets spaced by 0.10,
e.g. from 0 to 0.10, from 0.10 to 0.20, etc.
What is the best way to do this?
Thanks, Joel
On Tue, Jul 27, 2010 at 09:25:05PM -0400, Patrick May wrote:
> On Jul 27, 2010, at 9:21 PM, Steve Atkins wrote:
> > select date_trunc('hour', foo) + interval '30 minutes' *
> > floor(extract(minute from foo) / 30) as start, event, count(*) from bar
> > group by 1, 2 order by 1 asc;
>
> Tha
On Jul 27, 2010, at 9:21 PM, Steve Atkins wrote:
> On Jul 27, 2010, at 6:07 PM, Patrick May wrote:
>> On Jul 27, 2010, at 7:12 PM, Dann Corbit wrote:
I have a table containing events with timestamps. I would like
to generate a histogram of the number of each type of event for each
>>>
On Jul 27, 2010, at 6:07 PM, Patrick May wrote:
> On Jul 27, 2010, at 7:12 PM, Dann Corbit wrote:
>>> I have a table containing events with timestamps. I would like
>>> to generate a histogram of the number of each type of event for each
>>> half-hour period from 8:00 am to 6:00 pm. Are the
On Jul 27, 2010, at 7:12 PM, Dann Corbit wrote:
>> I have a table containing events with timestamps. I would like
>> to generate a histogram of the number of each type of event for each
>> half-hour period from 8:00 am to 6:00 pm. Are there any tools that
>> will help me do this?
>
> GROUP
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Patrick May
> Sent: Tuesday, July 27, 2010 3:59 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] Histogram generator
>
> Hi,
&
Hi,
I have a table containing events with timestamps. I would like to
generate a histogram of the number of each type of event for each half-hour
period from 8:00 am to 6:00 pm. Are there any tools that will help me do this?
Thanks,
Patrick
smime.p7s
Description: S/MIME cryptograp
15 matches
Mail list logo