MadhanaGopal
Programmer
Hi,
I have one requirement.
select fld1 as col1 ,fld2 as col2,max(fld3) as col3 ,
count(*) as col4 from table1 group by fld1,fld2
It gives the result as
col1 col2 col3 col4
------------------------------------------
A B 25 5
A B 15 15
A B 5 20
C D 10 6
C D 12 13
C D 17 18
| | | |
| | | |
I need one row for each fld1,fld2 which has maximum
count(*).
I want result like this.
col1 col2 col3 col4
------------------------------------------
A B 5 20
C D 17 18
| | | |
| | | |
Is it possible to get the result in a single query?
Thanx in Advance. P.Madhana Gopal,
Principal Software Engineer,
LCube Innovative Solns. Pvt. Ltd.,
India.
I have one requirement.
select fld1 as col1 ,fld2 as col2,max(fld3) as col3 ,
count(*) as col4 from table1 group by fld1,fld2
It gives the result as
col1 col2 col3 col4
------------------------------------------
A B 25 5
A B 15 15
A B 5 20
C D 10 6
C D 12 13
C D 17 18
| | | |
| | | |
I need one row for each fld1,fld2 which has maximum
count(*).
I want result like this.
col1 col2 col3 col4
------------------------------------------
A B 5 20
C D 17 18
| | | |
| | | |
Is it possible to get the result in a single query?
Thanx in Advance. P.Madhana Gopal,
Principal Software Engineer,
LCube Innovative Solns. Pvt. Ltd.,
India.