Wow! I cant believe it, it works (:
thank you so much! Atrix ----- Original Message ----- From: "Bill Downall" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, July 09, 2003 3:27 PM Subject: [RBASE-L] - Re: sql question > Atrix, > > Yes. > > I presume you want to count distinct tranid's for each userno. If that's not > what you want, explain again. Otherwise: > > SELECT userno, COUNT (*), COUNT (DISTINCT transid) > FROM users > WHERE type = 1 > GROUP BY userno > > Might give you what you want. (Might even give you what you don't want, > which is the middle COUNT (*), giving you exactly what you got with your > COUNT (userno). > > Bill > > On Wed, 9 Jul 2003 15:12:35 -0700, Atrix Wolfe wrote: > > >heya guys, i got an sql question > > > >i have a table called users with a userno column, a tranid column and a > >type column > > > >im trying to get the userno's and the count of the userno's from this > >table for type '1'. > > > >i was doing this: > > > >sel userno count(userno) > >from users > >where type=1 > >group by userno > > > >that works good however i want to make it only count distinct tranid's > >cause this is a summary of another peice of data which only shows > >distinct tranid's and it would be nice if they matched hehe (: > > > >Is this possible with sql? > > > >Thanks! > >Atrix >

