[SQL] Help with sql statement grouping and distinct

2004-07-09 Thread David Inglis
I want to be able to select a distinct group of rows from 2 tables and then once selected to group and total the results from the previous sql statement I have been trying the following select a.id_fk_accommodation, a.id_fk_selection,a.type,sum(1) from acommodationlog a, log l where (id_fk_a

Re: [SQL] Help with SQL

2002-10-16 Thread Eric L. Blevins
11031 Drew| 30 |104 zombiechick | 3 |159 (4 rows) Thanks for your help! Eric L. Blevins - Original Message - From: "Oliver Elphick" <[EMAIL PROTECTED]> To: "Eric L. Blevins" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: We

Re: [SQL] Help with SQL

2002-10-16 Thread Oliver Elphick
On Wed, 2002-10-16 at 19:26, Eric L. Blevins wrote: > I've got 2 SQL statements I would like to combine into one. ... > statement 1: SELECT uid, count(uid) FROM triangulated WHERE uid != 'anonymus' AND >uid > != 'anonymous' AND uid != '' GROUP BY uid ORDER BY count DESC LIMIT 10; ... > statemen

[SQL] Help with SQL

2002-10-16 Thread Eric L. Blevins
I'm new to postgres. I've got 2 SQL statements I would like to combine into one.   I think I need to use a sub select or join I am not sure. Any help would be appreciated!   statement 1: SELECT  uid, count(uid)  FROM triangulated WHERE uid != 'anonymus' AND uid!= 'anonymous' AND uid != '' GRO

Re: [SQL] Help with SQL statement - Thanks

2001-07-16 Thread James Orr
, 2001 3:16 PM Subject: [SQL] Help with SQL statement - Thanks > There is a table called "Payments" which records every payment that a > company has received: > > CustomerNo DateAmount > > 3214