Re: [sqlite] Re: Unexpected Query Results

2007-02-21 Thread Rich Shepard

On Wed, 21 Feb 2007, Igor Tandetnik wrote:


Yes, that's what GROUP BY does. One representative for each group.


Igor,

  A-ha! It has been a long time for me.


select * from voting order by cat, pos;


  Thank you very much. Makes sense now.

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.|  Accelerator(TM)
 Voice: 503-667-4517  Fax: 503-667-8863

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Unexpected Query Results

2007-02-21 Thread Igor Tandetnik

Rich Shepard <[EMAIL PROTECTED]> wrote:

  The table has 180 rows and 31 columns. What I need to do is extract
the records and group them by two columns (one as a sub-group of the
other). However, even one 'group by' retrieves only three records,
the last one for each group:


Yes, that's what GROUP BY does. One representative for each group.


  What I expected was all 180 records, with 60 in each of the 'cat'
fields (second field above).


select * from voting order by cat;


  Ultimately, I need to group them by the second field (name ==
'cat') and within each of those, sub-group them by the third field
(name == 'pos').


select * from voting order by cat, pos;

Igor Tandetnik

-
To unsubscribe, send email to [EMAIL PROTECTED]
-