Actually it seems I hadn't tried hard enough ;)
   
  I managed to make it work using the following syntax (Thanks to Jay) :
   
  SELECT SUM(SomeField)
FROM (some complex nested SELECT query)
  GROUP BY SomeOtherField;
   
  However I need to explicitely name all the fields of my intermediate query 
(SomeField and SomeOtherField) using the "AS" keyword.  Otherwise SQLite 
complains.
   
  Thanks all for your input.
   
  Yannick L.
  


Yannick Létourneau <[EMAIL PROTECTED]> wrote:
  I tried that as well, doesn't work either.

The thing is, my intermediate query is quite complex (involving UNION and GROUP 
BY) which requires me to do nesting.

I don't want to dump the intermediate results in a dummy table either.

Yannick L.

Jay Sprenkle wrote:
Access isn't very compatible with anything else ;)
why is the outer select wrapped around the inner query?
why not just put the group by on the inner query?

SELECT SUM(SomeField)
FROM complex query tables here
GROUP BY SomeOtherField



On 4/8/07, Yannick Létourneau wrote:
>
> I used to do this kind of SELECT statement in MS Access. This syntax
> doesn't seem to be understood by SQLite. Can someone help me find the
> SQLite syntax for doing this ?
>
> SELECT SUM(IntermediateQuery.SomeField)
> FROM (some complex nested SELECT query) AS IntermediateQuery
> GROUP BY IntermediateQuery.SomeOtherField
>
> SQLite complains there is no such field as IntermediateQuery.SomeField..
> .
>
> Any help ?
> Emp
>



-- 
--
The PixAddixImage Collector suite:
http://groups-beta.google.com/group/pixaddix

SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com


Reply via email to