Home » SQL & PL/SQL » SQL & PL/SQL » Select statement with group by
Select statement with group by [message #253645] |
Tue, 24 July 2007 08:37 |
arik_x
Messages: 6 Registered: July 2007
|
Junior Member |
|
|
Hello,
I was wondering how can I select a column from a table, but I do not need to include this column in group by clause?
Thanks
|
|
|
|
Re: Select statement with group by [message #253647 is a reply to message #253645] |
Tue, 24 July 2007 08:47 |
arik_x
Messages: 6 Registered: July 2007
|
Junior Member |
|
|
Table columns: a, b, c, d, e, f, g
How can I select all the columns, but group by only b, c, d, e, f, and g.
|
|
|
|
Re: Select statement with group by [message #253783 is a reply to message #253645] |
Tue, 24 July 2007 16:31 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
select a, b, c, d, e, f, g
from my_table
group by b, c, d, e, f, g;
If you are only pulling from a single table, this will have the effect of negating the group by. However if you had something like
select a.a, b.b, b.c, b.d, b.e, b.f, b.g
from my_table a, my_other_table b
where a.a = b.a
group by b.b, b.c, b.d, b.e, b.f, b.g;
might return useful groupings.
|
|
|
Goto Forum:
Current Time: Sat Dec 07 05:02:46 CST 2024
|