[sqlite] GROUP BY With ASC/DESC

2011-11-12 Thread danap
Given the following table: DROP TABLE IF EXISTS key_table5; CREATE TABLE key_table5 ( name TEXT NOT NULL default '', color TEXT default NULL, price REAL default NULL, UNIQUE (name), PRIMARY KEY (color) ); I'm getting the following exception: SQLException: [SQLITE_ERROR] SQL error or missing

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread danap
> Message: 23 > Date: Fri, 11 Nov 2011 10:57:22 -0500 > From: da...@dandymadeproductions.com > To: sqlite-users@sqlite.org > Subject: [sqlite] GROUP BY With ASC/DESC > Message-ID: > <5ed601b698a020a8d790240cc05c8714.squir...@dandymadeproductions.com> > Conten

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Black, Michael (IS)
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of da...@dandymadeproductions.com [da...@dandymadeproductions.com] Sent: Friday, November 11, 2011 9:57 AM To: sqlite-users@sqlite.org Subject: EXT :[sqlite] GROUP BY With ASC/DESC Given the following table

[sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread danap
Given the following table: DROP TABLE IF EXISTS key_table5; CREATE TABLE key_table5 ( name TEXT NOT NULL default '', color TEXT default NULL, price REAL default NULL, UNIQUE (name), PRIMARY KEY (color) ); I'm getting the following exception: SQLException: [SQLITE_ERROR] SQL error or missing

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Richard Hipp
On Fri, Nov 11, 2011 at 8:20 AM, Simon Slavin wrote: > > On 11 Nov 2011, at 1:15pm, Igor Tandetnik wrote: > > > ASC is not valid with GROUP BY, only with ORDER BY. What is it supposed > to achieve, anyway? Your query makes no sense to me. > > Igor, I started out to write

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Jay A. Kreibich
On Fri, Nov 11, 2011 at 02:24:54PM +0100, Jean-Christophe Deschamps scratched on the wall: > >Is this a bug or a query statement inaccuracy on my part? > > Looks like a documentation bug. Indeed the select-core diagram > incorrectly shows an ordering-term in the GROUP BY clause. It > should

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Jean-Christophe Deschamps
SELECT name, color, Sum(price) AS price FROM key_table5 WHERE price > '2' GROUP BY color ASC ORDER BY name ASC LIMIT 50 OFFSET 0 when either ASC or DESC is used with the GROUP BY clause. Is this a bug or a query statement inaccuracy on my part? Looks like a documentation bug. Indeed the

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Simon Slavin
On 11 Nov 2011, at 1:15pm, Igor Tandetnik wrote: > ASC is not valid with GROUP BY, only with ORDER BY. What is it supposed to > achieve, anyway? Your query makes no sense to me. Igor, I started out to write exactly the same thing, but then I saw the diagram on

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Igor Tandetnik
dmp wrote: > I'm getting the following exception: > > SQLException: [SQLITE_ERROR] SQL error or missing database (near "ASC": syntax > error) > > with: > > SELECT name, color, Sum(price) AS price FROM key_table5 WHERE price > '2' > GROUP > BY color ASC ORDER BY name ASC

Re: [sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread Simon Slavin
On 11 Nov 2011, at 2:23am, dmp wrote: > I'm getting the following exception: > > SQLException: [SQLITE_ERROR] SQL error or missing database (near "ASC": > syntax error) > > with: > > SELECT name, color, Sum(price) AS price FROM key_table5 WHERE price > '2' > GROUP BY color ASC ORDER BY name

[sqlite] GROUP BY With ASC/DESC

2011-11-11 Thread dmp
Given the following table: DROP TABLE IF EXISTS key_table5; CREATE TABLE key_table5 ( name TEXT NOT NULL default '', color TEXT default NULL, price REAL default NULL, UNIQUE (name), PRIMARY KEY (color) ); I'm getting the following exception: SQLException: [SQLITE_ERROR] SQL error or missing