consider some table with 4 r 5 columns in that 1 col is
DATE type. The data is like that,For each date in that col
some 3 fields r there but all the records r having
different data. Now i want to display all the columns by
performing grouping on the date field ( as SELECTION
Operator(*) cannot be used with group function having only
one "group by clause". how to do this? can any one help me
in finding out the solution plss?

Answer Posted / mukti singh

First of all you need to understand that purpose of
grouping.
Group by is used when you need to club a few columns on the
basis of one column, for this you need to use some
aggregate functions,

for eg. for a table test
a b c
1 2 29-JUN-08
1 4 29-JUN-08
3 5 04-JUL-08
13 15 05-JUL-08

you can group a and b on c as follows:-
select count(a), max(b), c from test
group by c
count(a)max(b) c
2 4 29-JUN-08
1 5 04-JUL-08
1 15 05-JUL-08

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are truncate and delete commands same? If so why?

658


How do I uninstall oracle client from windows?

542


What is the data pump export utility?

650


What is the Tune Query

1851


How to assign data of the deleted row to variables?

587






How many types of tables are there in oracle?

582


How to commit the current transaction in oracle?

581


How to recover a dropped table in oracle?

612


What are the oracle built-in data types?

570


Select all the employees who were hired in last 2 years and who works in dept where max managers are working.

2460


What are the restrictions on external table columns?

552


is there a tool to trace queries, like profiler for sql server?

614


How to view all columns in an existing table?

552


Is oracle an open source?

640


What is oracle server autotrace in oracle?

620