no id grp cmod dmod 1 1 1 1 2 1 1 1
original query returns one row your query should return 2 rows I think he needs to give a specific example of what he wants (ie values, as above) to get an answer that relates to his problem. david jencks On 2001.10.10 03:25:35 -0400 Edward Q. Bridges wrote: > would this do it? > > select grp, cmod, dmod from table where > grp in (select distinct grp from table) > > > > > On Tue, 9 Oct 2001 19:17:43 -0400, David Jencks wrote: > > >unfortunately your question makes no sense. If the GRP value does not > >determine the CMOD and DMOD values, which one of the rows with a given > GRP > >value do you want? If there is an aggregation function that can > sensibly > >be applied to CMOD and DMOD, you can do a group by query select grp, > >f(CMOD), f(DMOD) from TABLE group by grp where f is the aggregation > >function (sum, min, max, etc) > > > >david jencks > > > >On 2001.10.09 17:27:05 -0400 [EMAIL PROTECTED] wrote: > >> Sorry my internet access is down so I am going to try and ask this > >> question > >> here instead of at a related site. > >> I need to do a query like this: > >> String sql="SELECT DISTINCT GRP,CMOD,DMOD FROM TABLE"; > >> The problem is I only want distinct on the first column(GRP) but it > >> returns > >> all distinct combinations of the above three columns. > >> Any sql pros out there? > >> THANKS!! Graham > >> > >> _______________________________________________ > >> JBoss-user mailing list > >> [EMAIL PROTECTED] > >> https://lists.sourceforge.net/lists/listinfo/jboss-user > >> > >> > > > >_______________________________________________ > >JBoss-user mailing list > >[EMAIL PROTECTED] > >https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
