Re: [GENERAL] Problem with getting the right order

1998-10-22 Thread Ulf Mehlig
Generally, something like select count(vnr), enr from votes group by err order by 1 desc should work. But I tried it only with my own tables ... For referencing to the first column of the resulting table ("order by 1") you can also use select count(vnr) as the

Re: [GENERAL] Problem with getting the right order

1998-10-21 Thread dustin sallings
On Wed, 21 Oct 1998, Henrik Pedersen wrote: // When i do a : // // ./psql -c "select count(vnr),enr from votes where cnr=1 group by enr" // vote // This is almost what i want, execpt that i want the result to be // ordered by count, instead og enr. so that the entry, which got most // votes is

[GENERAL] Problem with getting the right order

1998-10-21 Thread Henrik Pedersen
I have a datbase that look like this: vnr|cnr|enr| ip|dato ---+---+---+---+-- 1| 1| 17|195.192.136.223|1998-10-14 02:30:18+02 2| 1| 1|195.192.136.164|1998-10-14 02:33:03+02 5| 1| 13|195.192.136.173|1998-10-14 02:49:24+02 8|