![]() | |
#1
| |||
| |||
|
|
robertzeller21 (AT) aol (DOT) com (Robert Zeller 21) wrote in message news:<20030802091838.13267.00000805 (AT) mb-m10 (DOT) aol.com>... How on earth is it possible to execute a query that joins 4 tables and uses 'GROUP BY' with aggregate functions? How the hell do you do this if the SELECT statement cannot specify items that are not in the GROUP BY statement??!!! TIA peeps What do you mean? Could you provide the ddl for the 4 tables you mention, and what you would like your query to return. Meanwhile, the following query joins four tables and uses an aggregate function: select a.m, b.n, count(1) from a, b, c, d where a.x = b.x and b.y = c.y and c.z = d.z group by a.m, b.n |
#2
| |||
| |||
|
|
genew (AT) mail (DOT) ocis.net (Gene Wirchenko) wrote in message news:<3f2c1682.19339969 (AT) news (DOT) ocis.net>... [...] So what does it mean when no fields are selected from a table specified in the from clause? Nothing special? Not that I can think off. Anything special that you had in mind? |
#3
| |||
| |||
|
|
lennart (AT) kommunicera (DOT) umea.se (Lennart Jonsson) wrote: genew (AT) mail (DOT) ocis.net (Gene Wirchenko) wrote in message news:<3f2c1682.19339969 (AT) news (DOT) ocis.net>... |
|
So what does it mean when no fields are selected from a table specified in the from clause? Nothing special? Not that I can think off. Anything special that you had in mind? Well, I suppose it would mean that such tables have columns being referred to somewhere in the statement, but I had a nagging doubt that maybe, the results are undefined. (I am not an SQL expert.) |
#4
| |||
| |||
|
|
genew (AT) mail (DOT) ocis.net (Gene Wirchenko) wrote in message news:<3f2de010.14943956 (AT) news (DOT) ocis.net>... lennart (AT) kommunicera (DOT) umea.se (Lennart Jonsson) wrote: genew (AT) mail (DOT) ocis.net (Gene Wirchenko) wrote in message news:<3f2c1682.19339969 (AT) news (DOT) ocis.net>... [...] So what does it mean when no fields are selected from a table specified in the from clause? Nothing special? Not that I can think off. Anything special that you had in mind? Well, I suppose it would mean that such tables have columns being referred to somewhere in the statement, but I had a nagging doubt that maybe, the results are undefined. (I am not an SQL expert.) There is nothing strange (normally) with such a query. Concider the following rather silly example: |
![]() |
| Thread Tools | |
| Display Modes | |
| |