Multiple examples...
 
select upper(softfile.filedesc), count(softfile.filedesc)
  from softfile, softinv
 where softfile.fileid = softinv.fileid
   and upper(softfile.filedesc) like '%ACCESS%'
 group by upper(softfile.filedesc)
 order by upper(softfile.filedesc)
 
select field1, field2count(field2)
  from table
group by field1, field2
 
 
You can also use the having clause to limit the query results...
 
 
select app_name, count(app_name)
  from application_temp
having count(app_name) > &count
 group by app_name
 order by app_name
 
 
select trim(field1), trim(field2)
  from table
 where trim(field3) = 'VALUE'
having count(trim(field2)) > 1
 group by trim(field1), trim(field2)
 order by trim(field1), trim(field2)
 
 
-MEB
 
 
-----Original Message-----
From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 5:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [KCFusion] an easy one

Girish do you have a real world example of the proper usage of the group by clause? My book is real weak on this subject.
A.
----- Original Message -----
Sent: Monday, June 23, 2003 5:00 PM
Subject: RE: [KCFusion] an easy one


Looks like what he needs is

SELECT  DISTINCT...
FROM table name
WHERE
GROUP BY

Girish





[EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]

06/23/2003 05:06 PM
Please respond to CF-List

       
        To:        [EMAIL PROTECTED]
        cc:        
        Subject:        RE: [KCFusion] an easy one



The results should have 1 of each student in a group, ex:
                stu1/grpA
                stu1/grpB
                stu2/grpA
                stu2/grpC

I believe the only way to get only 1 record for each student would be:
                SELECT DISTINCT table1.studentID
                FROM table1

Keep in mind that I'm no SQL guru...

Tyson

-----Original Message-----
From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 4:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [KCFusion] an easy one


Yes
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 3:56 PM
Subject: RE: [KCFusion] an easy one


> Are the studentID and goalID unique when combined?
>
> -----Original Message-----
> From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 23, 2003 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [KCFusion] an easy one
>
>
> Tried that still got a funny record set. Here is a simplifaction of the
> statement
>
> SELECT  DISTINCT table1.studentID, table2.goalID
> FROM table1, table2
> WHERE table1.studentID = table2.studentID
>
> I still keep getting multiple tuples for one studentID
> A.
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 23, 2003 3:31 PM
> Subject: RE: [KCFusion] an easy one
>
>
> > SELECT DISTINCT id
> >
> > -----Original Message-----
> > From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]
> > Sent: Monday, June 23, 2003 3:33 PM
> > To: [EMAIL PROTECTED]
> > Subject: [KCFusion] an easy one
> >
> >
> > Its been so long since ive done this i forgot how. In an sql statement i
> > want only unique values of a field. I tried
> > SELECT Unique (id) as id
> >
> > but that did not work.
> > A.
> >
> >
> >
> >
> > ______________________________________________________________________
> > The KCFusion.org list and website is hosted by Humankind Systems, Inc.
> > List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
> > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
> > To Subscribe.................... mailto:[EMAIL PROTECTED]
> > To Unsubscribe................ mailto:[EMAIL PROTECTED]
> >
> >
> >
> > ______________________________________________________________________
> > The KCFusion.org list and website is hosted by Humankind Systems, Inc.
> > List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]

> > Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
> > To Subscribe.................... mailto:[EMAIL PROTECTED]
> > To Unsubscribe................ mailto:[EMAIL PROTECTED]
> >
> >
>
>
>
>
> ______________________________________________________________________
> The KCFusion.org list and website is hosted by Humankind Systems, Inc.
> List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
> Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
> To Subscribe.................... mailto:[EMAIL PROTECTED]
> To Unsubscribe................ mailto:[EMAIL PROTECTED]
>
>
>
> ______________________________________________________________________
> The KCFusion.org list and website is hosted by Humankind Systems, Inc.
> List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
> Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
> To Subscribe.................... mailto:[EMAIL PROTECTED]
> To Unsubscribe................ mailto:[EMAIL PROTECTED]
>
>




______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]



______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]

 


Reply via email to