It has been a long time since I've written SQL, and this may explain why a
select is not returning what I expect.

  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:

sqlite> select * from voting group by cat;
120|eco|con|8|0.333|5|4|0.333|6|0.2|3|3|4|5|4|0.5|5|1|0.5|0.5|8|0.167|0.333|8|2|4|7|0.025|0.025|0.5|9
60|nat|con|0.025|2|0.125|9|9|4|4|6|0.111|3|0.5|4|0.143|1|3|2|0.143|9|8|8|1|9|2|0.167|3|2|4|3
180|soc|con|6|0.167|0.143|0.125|0.2|0.333|9|9|9|5|2|5|0.2|0.5|0.333|6|8|6|0.143|1|1|5|0.143|2|6|0.333|3|0.5

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

  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'). I'm
obviously missing something when I read the SELECT page on the web site, so
I'd greatly appreciate a pointer.

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |          Accelerator(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

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

Reply via email to