Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Joe Wilson
--- Kurt Welgehausen <[EMAIL PROTECTED]> wrote:
> > select a from qqq group by b;
> 
> This question was discussed on the list a year or 2 ago.
> 
> The column a in the simple query above is meaningless; it's
> an arbitrary value from each group.  There are queries,
> however, where a non-grouped column is meaningful, such as
> a join where the grouping column is a foreign key that
> references the primary key of another table.

Although I don't follow your example, I suppose that if
someone wanted to select a not-so-random arbitrary member of a 
group then this GROUP BY extension would do the trick.

But I would favor an explicit approach that disallows this 
non-standard GROUP BY extension, and instead adds a new 
non-standard, easily understood aggregate function, such as:

  select arbitrary(a) from qqq group by b;

that would give comparable functionality yet still provide the 
traditional error checking one would expect with GROUP BY 
SELECT statements.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [sqlite] concurrency version 2.8.17

2006-08-23 Thread Mark Richards
That's the ticket.. and it looks like sqlite_busy_timeout() may be my 
answer.


Many thanks!

/m

[EMAIL PROTECTED] wrote:


Look in the www directory.  There are TCL script which output
HTML that goes (or went) onto the website.
--
D. Richard Hipp   <[EMAIL PROTECTED]>



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



Re: [sqlite] concurrency version 2.8.17

2006-08-23 Thread drh
Mark Richards <[EMAIL PROTECTED]> wrote:
> The source has a docs directory which contains an html file describing 
> lemon.
> 
> Otherwise there are no docs I can find in the source tree (other than 
> the source!).
> 

Look in the www directory.  There are TCL script which output
HTML that goes (or went) onto the website.
--
D. Richard Hipp   <[EMAIL PROTECTED]>


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



Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Jonathan Ellis

On 8/23/06, Andrew McCollum <[EMAIL PROTECTED]> wrote:

I find this feature useful, especially in queries which use aggregate
functions, such as the following:

SELECT sum(a) FROM tbl GROUP BY b

The question should be what the compelling reason is to remove a useful
feature.


... And *that* is exactly why Windows will always be full of security holes.

-Jonathan

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



Re: [sqlite] SQLite with Index

2006-08-23 Thread John Stanton

Sqlite creates B-Tree indices.  It is a form of self balancing tree index.

Manzoor Ilahi Tamimy wrote:


Dear All,

I have question about Index.

When we create an index  on a table then how SQLite manage it. Whether SQLite 
uses Hashing or some other technique to handle index.


Can some one guide me where can I find the details working process of SQLIte 
when we create Index. 



Best regards, 


Manzoor Ilahi Tamimy



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




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



Re: [sqlite] implementing busy_handler callback

2006-08-23 Thread John Stanton
I would endorse that.  It makes the logic simpler and execution more 
efficient compared with the various polling strategies used to look at 
file locks.  It is particularly the case if you multi-use is due to 
threading in a single process.


Ritesh Kapoor wrote:

I think a good way of using sqlite in a multithreaded app is to have
your own mutex lock for the DB.

Everytime you need to execute a query just call the lock() function for
your mutex and then proceed with sqlite3_exec() calls.  Followed by a
unlock() call.

Your mutex wouldn't return if the another thread is executing queries. 
The only thing you need to do is to remember to lock and then unlock the

mutex.  You could again put all this in a function and call that
function whenever you need to execute a query.

However if you really insist on using the busy handlers then I guess
someone on this mailing list would help you.  However my experience with
these handlers was that they made a mess of the code and later on the
code was incomprehensible to someone looking at the code for the first
time.





Subject:
[sqlite] implementing busy_handler callback
From:
[EMAIL PROTECTED]
Date:
Wed, 23 Aug 2006 10:17:58 +0530
To:
sqlite-users@sqlite.org

To:
sqlite-users@sqlite.org
CC:
[EMAIL PROTECTED], 
[EMAIL PROTECTED], 
[EMAIL PROTECTED], [EMAIL PROTECTED]



Hi All,

I am trying to integrate SQLite in a multithreaded C++ application which 
runs on Linux.  I have gone through the SQLIte documentation, but it's not 
clear whether the sqlite3_exec() will retry the query when the busy 
handler callback is implemented and returns a non-zero value.


From the sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*) 
definition it says "This routine identifies a callback function that might 
be invoked whenever an attempt is made to open a database table that 
another thread or process has locked. If the busy callback is NULL, then 
SQLITE_BUSY is returned immediately upon encountering the lock. If the 
busy callback is not NULL, then the callback will be invoked with two 
arguments. The second argument is the number of prior calls to the busy 
callback for the same lock. If the busy callback returns 0, then no 
additional attempts are made to access the database and SQLITE_BUSY is 
returned. If the callback returns non-zero, then another attempt is made 
to open the database for reading and the cycle repeats.


Does it mean the sqlite3_exec() internally takes care of invoking the 
query multiple times until the callback returns 0?  Can someone provide 
sample implementation for busy_handler callback and how the query is 
retried?


thanks,
Vadivel




***  FSS- Confidential   ***

***  FSS- Confidential   ***
"DISCLAIMER: This message is proprietary to Flextronics Software Systems (FSS) and is intended solely for the use of 
the individual to whom it is addressed. It may contain privileged or confidential information and should not be 
circulated or used for any purpose other than for what it is intended. If you have received this message in error, 
please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly
prohibited from using, copying, altering, or disclosing the contents of this message. FSS accepts no responsibility for 
loss or damage arising from the use of the information transmitted by this email including damage from virus."






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



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



Re: [sqlite] running a script?

2006-08-23 Thread Clark Christensen
It should work fine with filenames with semicolons.  My problem is when I 
include the trailing semicolon, and it isn't really part of the filename or 
table name.

You _might_ need to use forward slashes instead of backslashes as the path 
separator inside the SQLite shell on Windows.  Or you might need to use double 
backslashes.  I remember having an issue like this, but I don't remember the 
details.  I've just started putting the files in the default dir.

 -Clark


- Original Message 
From: John Salerno <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org; [EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 1:22:03 PM
Subject: Re: [sqlite] running a script?

Thanks guys. Does any of this change for Windows though? I don't
believe I can use cat or | in the command prompt. I've also tried some
of those structures already and there seems to be a problem with my
file paths: C:\name\name\file.ext

I don't know if it's the colon or the slashes, but it won't work properly.

And about using .read and .import, does this mean you can't use them
on files that have semicolons in them?



On 8/23/06, Ulrich Schöbel <[EMAIL PROTECTED]> wrote:
> On Wednesday 23 August 2006 21:45, John Salerno wrote:
> > Hi everyone. Can someone tell me the proper syntax for running a sql
> > script when starting up sqlite from the command line interface?
> >
> > Thanks,
> > John
> >
> > ---
> >-- To unsubscribe, send email to [EMAIL PROTECTED]
> > ---
> >--
>
> cat scriptfile | sqlite3 mydb
>
> or
>
> sqlite3 -init scriptfile mydb
>
> or
>
> sqlite3 mydb < scriptfile
>
> or (for a single sql command)
>
> sqlite3 mydb 'sqlcmd'
>
> Kind regards
>
> Ulrich
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>

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





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



Re: [sqlite] running a script?

2006-08-23 Thread Clay Dowling

John Salerno said:
> I'm asking about an actual file, though, not just a single query. I've
> tried something like what you suggest with the file path, but it
> doesn't work.
>

sqlite database.db < script.sql


>
>
> On 8/23/06, Scott Baker <[EMAIL PROTECTED]> wrote:
>> echo "SELECT * FROM Table" | sqlite database.bin
>>
>> John Salerno wrote:
>> > Hi everyone. Can someone tell me the proper syntax for running a sql
>> > script when starting up sqlite from the command line interface?
>> >
>> > Thanks,
>> > John
>> >
>> > -
>> >
>> > To unsubscribe, send email to [EMAIL PROTECTED]
>> > -
>> >
>> >
>> >
>> >
>>
>> --
>> Scott Baker - RHCE
>> Canby Telcom System Administrator
>> 503.266.8253
>>
>> -
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> -
>>
>>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>


-- 
Simple Content Management
http://www.ceamus.com


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



Re: [sqlite] running a script?

2006-08-23 Thread John Salerno

Thanks guys. Does any of this change for Windows though? I don't
believe I can use cat or | in the command prompt. I've also tried some
of those structures already and there seems to be a problem with my
file paths: C:\name\name\file.ext

I don't know if it's the colon or the slashes, but it won't work properly.

And about using .read and .import, does this mean you can't use them
on files that have semicolons in them?



On 8/23/06, Ulrich Schöbel <[EMAIL PROTECTED]> wrote:

On Wednesday 23 August 2006 21:45, John Salerno wrote:
> Hi everyone. Can someone tell me the proper syntax for running a sql
> script when starting up sqlite from the command line interface?
>
> Thanks,
> John
>
> ---
>-- To unsubscribe, send email to [EMAIL PROTECTED]
> ---
>--

cat scriptfile | sqlite3 mydb

or

sqlite3 -init scriptfile mydb

or

sqlite3 mydb < scriptfile

or (for a single sql command)

sqlite3 mydb 'sqlcmd'

Kind regards

Ulrich

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




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



Re: [sqlite] running a script?

2006-08-23 Thread Clark Christensen
>From the SQLite shell

.read myfile

Or, from the OS command shell

sqlite3 foo.db ".read myfile"

.help in the SQLite shell will give you the available commands

Note.  For me, it's a habit to end lines in the SQLite shell with a semicolon.  
That breaks the .read and .import commands because the SQLite shell includes 
the trailing semicolon as part of the file or table identifier.

 -Clark


- Original Message 
From: John Salerno <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Wednesday, August 23, 2006 1:01:46 PM
Subject: Re: [sqlite] running a script?

I'm asking about an actual file, though, not just a single query. I've
tried something like what you suggest with the file path, but it
doesn't work.



On 8/23/06, Scott Baker <[EMAIL PROTECTED]> wrote:
> echo "SELECT * FROM Table" | sqlite database.bin
>
> John Salerno wrote:
> > Hi everyone. Can someone tell me the proper syntax for running a sql
> > script when starting up sqlite from the command line interface?
> >
> > Thanks,
> > John
> >
> > -
> >
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > -
> >
> >
> >
> >
>
> --
> Scott Baker - RHCE
> Canby Telcom System Administrator
> 503.266.8253
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>

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





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



Re: [sqlite] running a script?

2006-08-23 Thread Ulrich Schöbel
On Wednesday 23 August 2006 21:45, John Salerno wrote:
> Hi everyone. Can someone tell me the proper syntax for running a sql
> script when starting up sqlite from the command line interface?
>
> Thanks,
> John
>
> ---
>-- To unsubscribe, send email to [EMAIL PROTECTED]
> ---
>--

cat scriptfile | sqlite3 mydb

or

sqlite3 -init scriptfile mydb

or

sqlite3 mydb < scriptfile

or (for a single sql command)

sqlite3 mydb 'sqlcmd'

Kind regards

Ulrich

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



Re: [sqlite] running a script?

2006-08-23 Thread John Salerno

I'm asking about an actual file, though, not just a single query. I've
tried something like what you suggest with the file path, but it
doesn't work.



On 8/23/06, Scott Baker <[EMAIL PROTECTED]> wrote:

echo "SELECT * FROM Table" | sqlite database.bin

John Salerno wrote:
> Hi everyone. Can someone tell me the proper syntax for running a sql
> script when starting up sqlite from the command line interface?
>
> Thanks,
> John
>
> -
>
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
>
>
>
>

--
Scott Baker - RHCE
Canby Telcom System Administrator
503.266.8253

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




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



Re: [sqlite] running a script?

2006-08-23 Thread Scott Baker
echo "SELECT * FROM Table" | sqlite database.bin

John Salerno wrote:
> Hi everyone. Can someone tell me the proper syntax for running a sql
> script when starting up sqlite from the command line interface?
> 
> Thanks,
> John
> 
> -
> 
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
> 
> 
> 

-- 
Scott Baker - RHCE
Canby Telcom System Administrator
503.266.8253

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



[sqlite] running a script?

2006-08-23 Thread John Salerno

Hi everyone. Can someone tell me the proper syntax for running a sql
script when starting up sqlite from the command line interface?

Thanks,
John

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



RE: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Andrew McCollum
I find this feature useful, especially in queries which use aggregate
functions, such as the following:

SELECT sum(a) FROM tbl GROUP BY b

The question should be what the compelling reason is to remove a useful
feature.

-Andrew McCollum


-Original Message-
From: Kurt Welgehausen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 23, 2006 7:02 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Seems like a bug in the parser

> select a from qqq group by b;

This question was discussed on the list a year or 2 ago.

The column a in the simple query above is meaningless; it's
an arbitrary value from each group.  There are queries,
however, where a non-grouped column is meaningful, such as
a join where the grouping column is a foreign key that
references the primary key of another table.

I don't remember whether the '92 std calls this an error,
but later stds allow the dbms to analyze such functional
dependencies to decide whether to accept or reject a query
with a non-grouped column in the column list.  In SQLite
you have to do the functional-dependency analysis yourself.

Regards


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


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



Re: [sqlite] sqlite book

2006-08-23 Thread Bud Beacham
I have purchased two books on SQLite.
   
  "The Definitive Guide to SQLite" by Micheal Owens covers version 3.
  "SQLite" by Chris Newman covers version 2, but most is applicable to version 
3.
   
  I have found both to be helpful, and would recommend buying either, or both.
   
  However, IMO they both spend to much time on C, and not enough time on Tcl.  
Also, neither book mentions that the Tcl implementation throws an exception for 
most SQLite errors versus just returning the appropriate errorcode value.

Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:
  Hello.. Please I need to know if is there a Good book about SQLite i want to
learn it, i want to know how to optimize and how it works

Thanks to all



Re: [sqlite] spanish chars

2006-08-23 Thread Will Leshner

On 8/23/06, Preston Z <[EMAIL PROTECTED]> wrote:


the problem is when i get the data through the C api with a call to
sqlite3_get_table, the chars are missing/distorted.


Are they missing/distorted, or, is the method you are using to inspect
them not understanding the encoding they are in. You do need to make
sure that you put them in as UTF8, and then, when you retreive them,
that you are examining/using them as UTF8.

FWIW, I use SQLite all the time to put UTF8 text in and get UTF8 text
out and I've never had a problem in either direction.

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



[sqlite] Subquery occassionally returns null

2006-08-23 Thread Nathan Biggs
I am occasionally getting a strange behavior on one of my queries where
the sub-query is returning NULL even though the record exists.
 
Here is the query:
 
Insert into table2 values (2, (select id from table1 where x = '12345'
and y = '4567'), 0);
 
The record for table1 where x = '12345' and y = '4567' does exist, but
occasionally it puts a Null in the second field for table2 insert query.
 
Any ideas?
 
 


[sqlite] spanish chars

2006-08-23 Thread Preston Z

I haven't worked with internationalization much before so please
forgive me if this is a stupid question or not related to sqlite.

I have an charset problem using sqlite 3.2.2, I run into the following issue:

we have started adding spanish transaltions to our database. The app
that loads the data seems fine, i can look at the data through the
command line tool and the data looks ok.

the problem is when i get the data through the C api with a call to
sqlite3_get_table, the chars are missing/distorted.

would prepare/step work any differently? do i need to call the UTF-16 calls?

Thanks,
Preston

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



Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Kurt Welgehausen
> select a from qqq group by b;

This question was discussed on the list a year or 2 ago.

The column a in the simple query above is meaningless; it's
an arbitrary value from each group.  There are queries,
however, where a non-grouped column is meaningful, such as
a join where the grouping column is a foreign key that
references the primary key of another table.

I don't remember whether the '92 std calls this an error,
but later stds allow the dbms to analyze such functional
dependencies to decide whether to accept or reject a query
with a non-grouped column in the column list.  In SQLite
you have to do the functional-dependency analysis yourself.

Regards

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



[sqlite] New DBManager Professional 3.3.3 (Enterprise Edition)

2006-08-23 Thread COS
DBTools Software is pleased to announce the new DBManager Professional 3.3.3
Enterprise Edition.
This version is a major bug fix with a few extra funcionality added to the
application.

For a complete lists of changes check
http://www.dbtools.com.br/EN/article.php?id=00071.
You can download the latest version at
http://www.dbtools.com.br/EN/downloads.

What is DBManager?

DBManager is a commercial product for the Windows environment to manage
MySQL, PostgreSQL, Interbase, Firebird, SQlite, DBF, Microsoft Access,
Microsoft SQL Server, Sybase, Oracle and ODBC Datasources. It has a complete
set of Enterprise Features:

- Object Management (Including databases, tables, views, procedures,
functions, etc)
- Lots of wizards to Import and Export Structure and Data between databases
- Powerful Query and Procedure Builders, with multiple results and blob
viewer
- Form, Report and Diagram (ER) Designers
- Console
- Task Builder for process automations
- Server and Database Monitoring with charts
- and much more

For a complete list of features see
http://www.dbtools.com.br/EN/dbmanagerpro.

Best Regards,

DBTools Software
http://www.dbtools.com.br/EN


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



Re: [sqlite] Stop multiple simultaneous users

2006-08-23 Thread Jay Sprenkle

On 8/22/06, Dr Gerard Hammond <[EMAIL PROTECTED]> wrote:

Hi,

How can I stop multiple simultaneous users accessing a SQLite database?


use locking to obtain an exclusive lock

Is there a SQLite function that tells me how many people/applications
have the database open?


No, you want to ask the operating system how many processes/threads
have the database file open.

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



[sqlite] SQLite with Index

2006-08-23 Thread Manzoor Ilahi Tamimy


Dear All,

I have question about Index.

When we create an index  on a table then how SQLite manage it. Whether SQLite 
uses Hashing or some other technique to handle index.

Can some one guide me where can I find the details working process of SQLIte 
when we create Index. 


Best regards, 

Manzoor Ilahi Tamimy



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



[sqlite] Re: Seems like a bug in the parser

2006-08-23 Thread A. Pagaltzis
* Alexei Alexandrov <[EMAIL PROTECTED]> [2006-08-23 09:20]:
> All other databases I know will complain if you give them this query.

Except MySQL, glory that it is.

Regards,
-- 
Aristotle Pagaltzis // 

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



[sqlite] Partial indexes

2006-08-23 Thread Mikey C

Any plans to support partial indexes in SQLite?

http://en.wikipedia.org/wiki/Partial_index

http://db.cs.berkeley.edu/papers/ERL-M89-17.pdf

PostgreSQL supports them and they seem very useful.

-- 
View this message in context: 
http://www.nabble.com/Partial-indexes-tf2151623.html#a5941879
Sent from the SQLite forum at Nabble.com.


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



[sqlite] Re : [sqlite] how can i optimize this query

2006-08-23 Thread Pierre Aubert
Hello Cesar,
may be you can have a look at ft3 (ft3.sourceforge.net) which does the same 
thing.
Some advices:
* partition your table ft_index on wordid
   I use 1024  tables and use them like that:
ft_index[ wordid % 1024 ] 
  to access them. This reduce the size of the table and thus the size of the 
index.
* use a large block size via pragma (this speed up large reads)

FT3 ways is to switch to a binary index stored into a blob for each word. 
Something like
create table ft_index (
wordid int,
scores blob
);

and the blob is an array of (docid, rank, position, ...)

This is a lot faster of course but you have to deal with the join yourself.

PIerre.

P.S.: I will try to use the new virtual table interface to access the blob 
datas.

- Message d'origine 
De : Cesar David Rodas Maldonado <[EMAIL PROTECTED]>
À : sqlite-users@sqlite.org
Envoyé le : Mardi, 22 Août 2006, 10h10mn 30s
Objet : [sqlite] how can i optimize this query

I have the next table with about 10.000.000 of records-

CREATE TABLE ft_index (
  docid int(11) NOT NULL default '0',
  wordid int(11) NOT NULL default '0',
  posicion int(11) NOT NULL default '0',
  ranking float NOT NULL default '0',
  lang int(11) NOT NULL default '0',
  KEY docid (docid,wordid,posicion,ranking),
  KEY lang (lang)
);

How can i optimize the next query, couse i need velocity (this is for a
fulltext search project):


select
t0.*,
t0.ranking + t1.ranking + t2.ranking + t3.ranking + t4.ranking as ranking
from ft_index as t0
inner join ft_index as t1 on (t0.docid = t1.docid)
inner join ft_index as t2 on (t0.docid = t2.docid)
inner join ft_index as t3 on (t0.docid = t3.docid)
inner join ft_index as t4 on (t0.docid = t4.docid)
where (t0.wordid = '18929') AND (t1.wordid = '27283') AND( t2.wordid =
'4351' and t2.posicion + 1 = t3.posicion and t3.wordid = '9418' and
t3.posicion + 1 = t4.posicion ) group by t0.docid order by ranking;

Every inner join is for search a word that i save in another table (with the
number of words).






Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Mario Frasca

Joe Wilson wrote:


--- [EMAIL PROTECTED] wrote:


SQLite accepts the above and does the right thing with it.
It is the equivalent of saying:

  SELECT a FROM (SELECT a,b FROM qqq GROUP BY b);



Not sure what you mean by the "right thing". It's not obvious 
why the rows returned by this GROUP BY are significant.



sqlite> select a,b from qqq group by b;
2|9
3|10
-3|11

mysql> select a,b from qqq group by b;
+--+--+
| a| b|
+--+--+
| 4|9 |
| 1|   10 |
| 4|   11 |
+--+--+
3 rows in set (0.00 sec)

postgresql says:
ERROR:  column "qqq.a" must appear in the GROUP BY clause or be used in 
an aggregate function


oracle says:
ORA-00979: non è un'espressione GROUP BY
(in translation: this is not a GROUP BY expression)

as you see, the two engines returning a result give different results on 
the same data inserted in the same order.  as Joe, I also don't see 
which should be considered "the" right thing and would rather have an 
error message.


what does SQL92 say?

regards,
Mario

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



Re: [sqlite] Seems like a bug in the parser

2006-08-23 Thread Alexei Alexandrov

On 8/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


SQLite accepts the above and does the right thing with it.
It is the equivalent of saying:

   SELECT a FROM (SELECT a,b FROM qqq GROUP BY b);



The subquery here doesn't make any sense to me. How a single 'a' is
chosen for the grouped by 'b' sets? I believe it's in SQL standard
that only columns listed in the "group by" clause or aggregation
expressions must be used. Basically, every expression in the column
list must be uniquelly determined for a set of grouped rows.

All other databases I know will complain if you give them this query.

--
Alexei Alexandrov

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