[ic] SIMPLE SQL-QUERY

John Rennie john-rennie at thechampagneshop.co.uk
Thu Oct 30 19:55:47 EST 2003


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
> Of halloween-shop at gmx.net
> Sent: 30 October 2003 19:07
> To: interchange-users at icdevgroup.org
> Subject: [ic] SIMPLE SQL-QUERY
> 
> 
> Hi everybody,
> 
> i am using ic 4.87 and have encountered a simple problem,
> which i can't seem to solve, it's ridiculous ... maybe it's 
> time for a break
> 
> i have a prod_group column (FORD, BMW, PONTIAC ...) and a 
> category (new, used, wreck ...) column all I want to show using SQL is
> 
> FORD    new(5)    used(2)
> BMW wreck(1)
> PONTIAC used(5) wreck(9)
> ....
> 
> I have tried using 'Group by' and 'Count' but I don't get it 
> right, because if I group them by prod_group, i can't get to 
> the category, and the other way around ??
> 
> any ideas,
> a link to a similar question (and answer) would be great too, 
> since i don't know what exactely to look for in the forum ...
> 
> regards
> 
> Steve
> 
Haven't tried it in Interchange, but the SQL statement
SELECT Products.prod_group, Products.category, Count(*) as total
FROM Products
GROUP BY Products.prod_group, Products.category;

should do what you want.

Regards,

John.



More information about the interchange-users mailing list