Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread flo
Effectively, Sorry about my mistake. 2016-08-17 10:33 GMT+02:00 Richard Hipp : > On 8/17/16, flo wrote: > > > > $ sqlite3 test.db "UPDATE test SET id=0 AND name='new_name' AND age=30 > > WHERE id=1;" > > The above is parsed like this: > > UPDATE test SET id = (0 AND name='new_name' AND age=30

Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread R Smith
On 2016/08/17 11:04 AM, Simon Davies wrote: On 17 August 2016 at 09:39, R Smith wrote: On 2016/08/17 9:05 AM, flo wrote: Hi everyone, . . . Well, it is perfectly valid to give boolean operations as an expression. If I said " id = 3 AND 6 then the resulting value would be 2 (If you are un

Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread Simon Davies
On 17 August 2016 at 09:39, R Smith wrote: > > > On 2016/08/17 9:05 AM, flo wrote: >> >> Hi everyone, . . . > Well, it is perfectly valid to give boolean operations as an expression. > If I said " id = 3 AND 6 then the resulting value would be 2 (If you are > unsure why that is you need to read u

Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread R Smith
On 2016/08/17 9:05 AM, flo wrote: Hi everyone, I found a reproducible bug on the SQL UPDATE statement parsing. Here is the details. I 've try to update some data on a SQLite database with a outlandish syntax with "AND" between the columns to be update. The SQL didn't fail but the data update

Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread Hick Gunter
prüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von flo Gesendet: Mittwoch, 17. August 2016 09:05 An: sqlite-users@mailinglists.sqlite.org Betreff: [sqlite] SQL Syntax fault on UPDATE statement Hi everyone, I found a reproducible b

Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread Richard Hipp
On 8/17/16, flo wrote: > > $ sqlite3 test.db "UPDATE test SET id=0 AND name='new_name' AND age=30 > WHERE id=1;" The above is parsed like this: UPDATE test SET id = (0 AND name='new_name' AND age=30) WHERE id=1; And since the expression in parentheses always evaluates to 0, the above is equiv

[sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread flo
Hi everyone, I found a reproducible bug on the SQL UPDATE statement parsing. Here is the details. I 've try to update some data on a SQLite database with a outlandish syntax with "AND" between the columns to be update. The SQL didn't fail but the data update was incomplete. The SQLite version

[sqlite] SQL Syntax To Copy A Table

2015-03-30 Thread Dominique Devienne
On Thu, Mar 26, 2015 at 4:29 PM, Nigel Verity wrote: > My requirement is to take periodic snapshots of a names and addresses > table, to be stored in the same database as the master. > Perhaps also look into https://www.sqlite.org/backup.html, which doesn't qualify for "the same database", but s

[sqlite] SQL Syntax To Copy A Table

2015-03-29 Thread Maurizio Trevisani
I suggest to use the CloneTable function Have a look at https://www.gaia-gis.it/fossil/libspatialite/wiki?name=CloneTable It copies the table and all of its triggers, indexes, etc. Maurizio 2015-03-26 16:35 GMT+01:00, John McKown : > On Thu, Mar 26, 2015 at 10:29 AM, Nigel Verity > wrote: >> Hi

[sqlite] SQL Syntax To Copy A Table

2015-03-26 Thread Martin Engelschalk
Hi Nige, create table as select * from See also http://www.sqlite.org/lang_createtable.html Martin Am 26.03.2015 um 16:29 schrieb Nigel Verity: > Hi > > I know this must seem a fairly dumb question, but I can't find an easy way to > create a copy of table using just SQL. > > My requirement i

[sqlite] SQL Syntax To Copy A Table

2015-03-26 Thread Nigel Verity
Hi I know this must seem a fairly dumb question, but I can't find an easy way to create a copy of table using just SQL. My requirement is to take periodic snapshots of a names and addresses table, to be stored in the same database as the master. The master table has one index - an auto-increme

[sqlite] SQL Syntax To Copy A Table

2015-03-26 Thread John McKown
On Thu, Mar 26, 2015 at 10:29 AM, Nigel Verity wrote: > Hi > > I know this must seem a fairly dumb question, but I can't find an easy way to > create a copy of table using just SQL. > > My requirement is to take periodic snapshots of a names and addresses table, > to be stored in the same datab

Re: [sqlite] sql syntax grammar: single-source

2011-04-05 Thread Vitali Kiruta
> This currently works.  But because it is not part of the language spec, we > do not guarantee that we will continue to support it. Thanks a lot for quick answer. Do you mean the sqlite language spec, or the sql standard? I would be very much in favor of keeping this behavior. It makes select st

Re: [sqlite] sql syntax grammar: single-source

2011-04-05 Thread Richard Hipp
On Tue, Apr 5, 2011 at 8:30 AM, Vitali Kiruta wrote: > Hi everybody, > > I hope somebody could clarify this for me. According to the sql > grammar definition, the single-source production > does not allow the table-alias after the join-source > > See http://www.sqlite.org/syntaxdiagrams.html#sing

[sqlite] sql syntax grammar: single-source

2011-04-05 Thread Vitali Kiruta
Hi everybody, I hope somebody could clarify this for me. According to the sql grammar definition, the single-source production does not allow the table-alias after the join-source See http://www.sqlite.org/syntaxdiagrams.html#single-source However, when I'm trying to run this query it works just

Re: [sqlite] SQL syntax diagrams

2010-01-15 Thread D. Richard Hipp
On Jan 15, 2010, at 9:10 AM, Andy Gibbs wrote: > > Hi, > > I really like the way the SQL syntax diagrams are done (e.g. at > http://www.sqlite.org/syntaxdiagrams.html) > . What software did you use for it? > http://wiki.tcl.tk/21708 Also: http://www.sqlite.org/faq.html#q25 and http://www.s

Re: [sqlite] SQL syntax diagrams

2010-01-15 Thread Dan Kennedy
On Jan 15, 2010, at 9:10 PM, Andy Gibbs wrote: > > Hi, > > I really like the way the SQL syntax diagrams are done (e.g. at > http://www.sqlite.org/syntaxdiagrams.html) > . What software did you use for it? http://wiki.tcl.tk/21708 > > Regards > Andy > >

[sqlite] SQL syntax diagrams

2010-01-15 Thread Andy Gibbs
Hi, I really like the way the SQL syntax diagrams are done (e.g. at http://www.sqlite.org/syntaxdiagrams.html). What software did you use for it? Regards Andy _ We want to hear all your f

Re: [sqlite] SQL Syntax

2009-07-09 Thread Rick Ratchford
sers@sqlite.org #>Subject: Re: [sqlite] SQL Syntax #> #>Rick Ratchford #>wrote: #>> select #>>(select min(Year) ...) as firstFullYear, #>>(select max(Year) ...) as lastFullYear; #>> #>> If I go with the condensed version you illustrate above, I #&g

Re: [sqlite] SQL Syntax

2009-07-09 Thread Igor Tandetnik
Rick Ratchford wrote: > select >(select min(Year) ...) as firstFullYear, >(select max(Year) ...) as lastFullYear; > > If I go with the condensed version you illustrate above, I assume > that I would then need to use the LIMIT clause, right? When I tried > it, I get a bunch of rows returned

Re: [sqlite] SQL Syntax

2009-07-09 Thread Rick Ratchford
Rick Ratchford wrote: > Okay, this worked, but I have NO IDEA why. > >SQLString = "SELECT min(Year) FROM TmpTable " & _ >"WHERE Month=1 UNION " & _ >"SELECT max(Year) FROM TmpTable " & _ >"WHERE Month = 12 LIMIT 2" Read about aggregate functions

Re: [sqlite] SQL Syntax

2009-07-09 Thread Rick Ratchford
Rick Ratchford wrote: > Okay, this worked, but I have NO IDEA why. > >SQLString = "SELECT min(Year) FROM TmpTable " & _ >"WHERE Month=1 UNION " & _ >"SELECT max(Year) FROM TmpTable " & _ >"WHERE Month = 12 LIMIT 2" Read about aggregate functions

Re: [sqlite] SQL Syntax

2009-07-09 Thread David Bicking
On Thu, 2009-07-09 at 10:47 +0200, Jean-Denis Muys wrote: > On 7/9/09 6:21 , "Rick Ratchford" wrote: > > > > > Okay, this worked, but I have NO IDEA why. > > > > SQLString = "SELECT min(Year) FROM TmpTable " & _ > > "WHERE Month=1 UNION " & _ > > "SELECT max

Re: [sqlite] SQL Syntax

2009-07-09 Thread Igor Tandetnik
Rick Ratchford wrote: > Okay, this worked, but I have NO IDEA why. > >SQLString = "SELECT min(Year) FROM TmpTable " & _ >"WHERE Month=1 UNION " & _ >"SELECT max(Year) FROM TmpTable " & _ >"WHERE Month = 12 LIMIT 2" Read about aggregate functions

Re: [sqlite] SQL Syntax

2009-07-09 Thread Jean-Denis Muys
On 7/9/09 6:21 , "Rick Ratchford" wrote: > > Okay, this worked, but I have NO IDEA why. > > SQLString = "SELECT min(Year) FROM TmpTable " & _ > "WHERE Month=1 UNION " & _ > "SELECT max(Year) FROM TmpTable " & _ > "WHERE Month = 12 LIMIT 2" >

Re: [sqlite] SQL Syntax

2009-07-08 Thread John Machin
or more days in Month=1 (Jan). > > Anyone? > > Thanks. > Rick > > > > Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rick Ratchford > Sent: Wednesday, July 08, 2009 11:17 PM > To: &#

Re: [sqlite] SQL Syntax

2009-07-08 Thread Rick Ratchford
oun...@sqlite.org] On Behalf Of Rick Ratchford Sent: Wednesday, July 08, 2009 11:17 PM To: 'General Discussion of SQLite Database' Subject: [sqlite] SQL Syntax I've been trying all kinds of different ways to accomplish the following, and my head is spinning. Problem: How do you return

[sqlite] SQL Syntax

2009-07-08 Thread Rick Ratchford
I've been trying all kinds of different ways to accomplish the following, and my head is spinning. Problem: How do you return from the DB just the YEAR of the first and last YEAR that had dates from 1st week of January to last week of December? Clarification: Suppose you had a database that co

[sqlite] SQL syntax issue?

2007-02-08 Thread Sherlock, Ric
I've come across the following SQL syntax issue in Sqlite that is maybe a bug (or maybe just a product of my poor SQL knowledge!) I have a database that from the command line will execute the following statement fine: SELECT clients.cl_lname, clients.cl_title, price_profiles.pp_year FROM clients L

RE: [sqlite] SQL syntax possibilities

2005-11-16 Thread roger
> Original Message > Subject: Re: [sqlite] SQL syntax possibilities > From: Darren Duncan <[EMAIL PROTECTED]> > Date: Wed, November 16, 2005 10:41 pm > To: sqlite-users@sqlite.org > > At 1:34 AM -0700 11/16/05, [EMAIL PROTECTED] wrote: > >u

Re: [sqlite] SQL syntax possibilities

2005-11-16 Thread Darren Duncan
At 1:34 AM -0700 11/16/05, [EMAIL PROTECTED] wrote: uSQLite does not (generally) enter into the details of the query it is passed. There is however an exception for security. uSQLite requires a login and (depending on the user and network) assigns the user a level: 0: No access 1: Select only 2:

RE: [sqlite] SQL syntax possibilities

2005-11-16 Thread roger
> Original Message > Subject: Re: [sqlite] SQL syntax possibilities > From: Eric Bohlman <[EMAIL PROTECTED]> > Date: Wed, November 16, 2005 10:54 am > To: sqlite-users@sqlite.org > > [EMAIL PROTECTED] wrote: > > uSQLite does not (generally) en

Re: [sqlite] SQL syntax possibilities

2005-11-16 Thread Eric Bohlman
[EMAIL PROTECTED] wrote: uSQLite does not (generally) enter into the details of the query it is passed. There is however an exception for security. uSQLite requires a login and (depending on the user and network) assigns the user a level: 0: No access 1: Select only 2: Update/Insert only 3: Sele

[sqlite] SQL syntax possibilities

2005-11-16 Thread roger
uSQLite does not (generally) enter into the details of the query it is passed. There is however an exception for security. uSQLite requires a login and (depending on the user and network) assigns the user a level: 0: No access 1: Select only 2: Update/Insert only 3: Select/Update/Insert only 4: Po

RE: [sqlite] SQL syntax - please help

2005-07-03 Thread Dennis Volodomanov
July 2005 7:31 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQL syntax - please help I don't think that SQLite supports what you want yet. As soon as the SQL:2003 "WITH RECURSIVE ... SELECT ..." syntax is supported, you should be able to do what you want elegantly.

Re: [sqlite] SQL syntax - please help

2005-07-01 Thread Darren Duncan
I don't think that SQLite supports what you want yet. As soon as the SQL:2003 "WITH RECURSIVE ... SELECT ..." syntax is supported, you should be able to do what you want elegantly. Meanwhile, you will have to do multiple selects to work with N recursions. -- Darren Duncan At 5:10 PM +1000 7/

[sqlite] SQL syntax - please help

2005-07-01 Thread Dennis Volodomanov
Hello all, I'm trying to form a specific query, but not sure if that's possible at all and if it is, how it should look like. I'd really appreciate your help :-) I have 2 tables (simplest case, but once I know this, I can work out the rest): CREATE TABLE TableA( UID INTEGER PRIMARY KEY,

Re: [sqlite] SQL Syntax from 2.8 to 3.0 not backward compatible?

2004-06-25 Thread Guillaume Fougnies
Ok. Perhaps it should be written in the documentation of "SQLite Version 3" or in the chapter "Transaction Control At The SQL Level" of the "Locking And Concurrency In SQLite Version 3". Thanks. bye. Fri, Jun 25, 2004 at 04:22:10AM -0700: Daniel K wrote: > A BEGIN cannot have an ON CONFLICT claus

Re: [sqlite] SQL Syntax from 2.8 to 3.0 not backward compatible?

2004-06-25 Thread Daniel K
A BEGIN cannot have an ON CONFLICT clause in sqlite version 3. Dan. --- Guillaume Fougnies <[EMAIL PROTECTED]> wrote: > Here is it: > > SQLite version 3.0.1 > Enter ".help" for instructions > sqlite> BEGIN TRANSACTION ON CONFLICT ROLLBACK; > SQL error: near "ON": syntax error > > bye. > -- > G

[sqlite] SQL Syntax from 2.8 to 3.0 not backward compatible?

2004-06-25 Thread Guillaume Fougnies
Here is it: SQLite version 3.0.1 Enter ".help" for instructions sqlite> BEGIN TRANSACTION ON CONFLICT ROLLBACK; SQL error: near "ON": syntax error bye. -- Guillaume FOUGNIES - To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

[sqlite] SQL syntax

2004-06-21 Thread aducom
Is there a document describing changes in sql statements, especially on pragma's? Which pragma's are understood? Albert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: [sqlite] SQL Syntax checker?

2004-05-05 Thread Keith Herold
Message- > From: Dan Keeley [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 05, 2004 2:36 AM > To: [EMAIL PROTECTED] > Subject: [sqlite] SQL Syntax checker? > > > Hi, > > Not directly sqlite related, but does anyone know of a SQL > syntax checker > which will ch

[sqlite] SQL Syntax checker?

2004-05-05 Thread Dan Keeley
Hi, Not directly sqlite related, but does anyone know of a SQL syntax checker which will check syntax without actually connecting to a db and running the query? Thanks! Dan _ Express yourself with cool new emoticons http://www.msn.