[sqlite] Selecting total and not used in one query

2015-12-12 Thread Luuk
On 12-12-15 15:45, Luuk wrote: > > > On 12-12-15 15:18, Cecil Westerhof wrote: >> ?I have the following query: >> SELECT >> (SELECT COUNT(*) FROM proverbs) AS Total >> , (SELECT COUNT(*) FROM proverbs WHERE NOT used IS NULL) AS Use

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Luuk
On 12-12-15 15:18, Cecil Westerhof wrote: > ?I have the following query: > SELECT > (SELECT COUNT(*) FROM proverbs)AS Total > , (SELECT COUNT(*) FROM proverbs WHERE NOT used IS NULL) AS Used > > But I want something like: > ?SELECT > (SELE

[sqlite] Simple Math Question

2015-11-07 Thread Luuk
On 23-10-15 16:39, Dominique Devienne wrote: > On Fri, Oct 23, 2015 at 4:16 PM, Rousselot, Richard A < > Richard.A.Rousselot at centurylink.com> wrote: > >> So I decided to output 1000 digits, because why not? So now I am more >> perplexed with all these digits showing it is working the opposite

[sqlite] Handling the whole select query from an index

2015-09-18 Thread Luuk
On 18-09-15 17:54, R.Smith wrote: > > As an aside, you know you can already do this via a Google API right? > That is, you can find a GPS location for an address or approximate > address (city & postal code will do). Usually, if the address is not > specific, the nearest road intersection GPS

[sqlite] [OT] Re: Worked in 3.8.9, but now "recursive aggregate queries not supported"

2015-09-13 Thread Luuk
On 13-09-15 15:45, Abilio Marques wrote: > This is for making a quick question and leaving a note: > ?? > > What is a recursive aggregate query? What is it useful for? Been using SQL > for a while, and is the first time I face the term. I even used Oracle for > a year and a half, and never saw a CO

[sqlite] [OT] Re: Worked in 3.8.9, but now "recursive aggregate queries not supported"

2015-09-13 Thread Luuk
On 13-09-15 14:57, E.Pasma wrote: > The rowcounts were: > > 1) 999 - aurel's original version is 3.8.9 > 2) 1000 - Luuks non-recursive version, same for my own trial > 3) 837 -the version with temp table > 4) 838 - DRH;s version > > and there is nothing to worry here. > The main difference is exp

[sqlite] Worked in 3.8.9, but now "recursive aggregate queries not supported"

2015-09-12 Thread Luuk
On 12-09-15 22:12, Aurel Wisse wrote: > @Luuk : I tried your query and I cancelled after 9 minutes when it wasn't > finished. > yes, it was/IS bad... i should stick to non-recursive queries select s1.calc_date, (select min(s2.calc_date) from securities s2

[sqlite] Worked in 3.8.9, but now "recursive aggregate queries not supported"

2015-09-12 Thread Luuk
On 12-09-15 16:36, Aurel Wisse wrote: > Yes it works, but it takes forever. By comparison: > > Original recursive query: 7-8 seconds (SQLite 3.8.10.1) > Non recursive query (see below): 18-19 seconds. (SQLite 3.8.10.1) > Proposed query: Not finished after 10 minutes. I am cancelling. > > Non recurs

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 06-09-15 20:46, Petr L?z?ovsk? wrote: > Thanks to all answers. Are principles of such script OK, or I miss something? > > > set "_error=" > sqlite3.exe %db% BEGIN; > for /f "tokens=2,3 delims=," %%a in (data.csv) do ( > sqlite3 %db% "INSERT INTO payments(id,amount) VALUES

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 06-09-15 15:26, Yuriy M. Kaminskiy wrote: > Luuk writes: > >> DELETE FROM test; >> BEGIN; >> INSERT INTO test VALUES(1,'test1'); >> INSERT INTO test VALUES(3,'test3',3); >> INSERT INTO test VALUES(2,'test2'); >> COMMIT;

[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Luuk
On 06-09-15 07:47, Scott Robison wrote: > On Sat, Sep 5, 2015 at 9:58 PM, Keith Medcalf wrote: > >> Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows. >> >> sqlite3x.c: In function 'sqlite3MemoryBarrier': >> sqlite3x.c:20410:17: error: expected expression before ')' token >>

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 05-09-15 22:27, Simon Slavin wrote: > On 5 Sep 2015, at 9:18pm, Petr L?z?ovsk? wrote: > >> Have some shell scripts working with sqlite. Receiving incoming payments >> from bank via HTTP API and pushing it into database. This script will start >> periodically, every single hour. >> >> Want t

[sqlite] CSV excel import

2015-08-01 Thread Luuk
On 30-7-2015 20:31, Sylvain Pointeau wrote: > On Thu, Jul 30, 2015 at 8:17 PM, Luuk wrote: > >> On 30-7-2015 20:07, Richard Hipp wrote: >> >>> On 7/30/15, Sylvain Pointeau wrote: >>> An Excel-to-SQLite converter utility sounds like it would be a great >

[sqlite] CSV excel import

2015-07-30 Thread Luuk
On 30-7-2015 20:07, Richard Hipp wrote: > On 7/30/15, Sylvain Pointeau wrote: >> I understood from the mailing list, that CSV is not a defined format, then >> let's propose another format, well defined, the Excel one (which is in my >> experience a format to is good every time I had to exchange CS

[sqlite] Query returns "stack overflow error"

2015-05-30 Thread Luuk
On 30-5-2015 02:53, Etienne Charland wrote: > I'm using SQLiteStudio. > > It's not easy to run it manually because of how the parameters must be > passed, and the function that doesn't exist within the database. > > I tried replacing all parameters by their value, and replacing the function > wit

[sqlite] sqlitediff

2015-05-24 Thread Luuk
On 24-5-2015 09:20, Marco Bambini wrote: > Luuk, that's really really funny thanks. > > Starting from sqlite 3.8.10 sqlitediff.exe has been added to the official > sqlite distribution. > I downloaded both the Amalgamation version and the Alternative Source Code > Fo

[sqlite] sqlitediff

2015-05-24 Thread Luuk
On 24-5-2015 08:39, Marco Bambini wrote: > Where can I download sqlitediff and its source code? > http://lmgtfy.com/?q=sqlitediff&l=1 or, more correct: http://lmgtfy.com/?q=sqlitediff+source

[sqlite] How mature/stable is SQLite 4 now? ETA?

2015-05-24 Thread Luuk
On 23-5-2015 21:14, Darren Duncan wrote: > More like It'll be out in time for Christmas, where the specific year > isn't mentioned. -- Darren Duncan > > On 2015-05-23 11:09 AM, Mikael wrote: >> This sounds like it means we'll have it 2.5-5 years then.. so 2018 maybe, >> ah, that's in the year when

[sqlite] Sample SQL code thats beyond me :(

2015-05-23 Thread Luuk
On 23-5-2015 18:41, Keith Medcalf wrote: > > You also lastly mention that the UUID fields are also used in the selection, > so the problem statement is really: > > Return the projection of Users and Perimeter_Notifications using the common > email field as the equijoin key, but return only the re

[sqlite] Windows 10 and UTF8 [Re: sqlite3 and Unicode]

2015-05-05 Thread Luuk
On 5-5-2015 12:40, Luuk wrote: > > now it becomes time that windows will do some things with UTF-8 > (sigh) ;-) > > /me currently watching > "Your PC will restart serveral times. Sit back and relax" > while installing updates for technical preview to Window

[sqlite] sqlite3 and Unicode

2015-05-05 Thread Luuk
On 5-5-2015 12:25, Clemens Ladisch wrote: > Staffan Tylen wrote: >> I must admit that I'm a bit confused here. If I'm not wrong UTF-8 differs >> from ascii when the value is higher than '7f'x, but storing data in sqlite >> as text with character values beteen 'x80'x and 'ff'x seems to be no >> prob

[sqlite] sqlite3 and Unicode

2015-05-05 Thread Luuk
On 5-5-2015 11:25, Kees Nuyt wrote: > On Tue, 05 May 2015 10:50:00 +0200, Clemens Ladisch > wrote: > >> Luuk wrote: >>> on Windows 7: >>> C:\temp>sqlite3.exe encoding.sqlite >>> sqlite> select * from test; >>> ??n >> >> The

[sqlite] sqlite3 and Unicode

2015-05-05 Thread Luuk
On 5-5-2015 09:22, Luuk wrote: > On 4-5-2015 20:54, Richard Hipp wrote: >> On 5/4/15, Peter Haworth wrote: >>> When using the .dump command with .output to a filename, what >>> encoding does >>> sqlite3 for the file? Same as the database encoding? Is it poss

[sqlite] sqlite3 and Unicode

2015-05-05 Thread Luuk
On 4-5-2015 20:54, Richard Hipp wrote: > On 5/4/15, Peter Haworth wrote: >> When using the .dump command with .output to a filename, what encoding does >> sqlite3 for the file? Same as the database encoding? Is it possible to >> change whatever encoding is used? >> >> Similarly, when using the .i

[sqlite] Why is empty string not equal to empty blob?

2015-03-29 Thread Luuk
On 29-3-2015 18:53, Simon Slavin wrote: > >> On 29 Mar 2015, at 5:31pm, Luuk wrote: >> >> On 19-3-2015 16:02, Simon Slavin wrote: >>> >>> One is a string. The other is a BLOB. SQLite doesn't even get as far as >>> testing the contents

[sqlite] Why is empty string not equal to empty blob?

2015-03-29 Thread Luuk
On 19-3-2015 16:02, Simon Slavin wrote: > > On 19 Mar 2015, at 2:56pm, Paul wrote: > >> Maybe this question was already asked and explained. >> Or maybe it is documented somewhere (could not fiund it). >> Sorry, if this is the case, but why does >> >> SELECT '' = x''; >> >> yields 0? > > One is a

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-09 Thread Luuk
On 9-12-2014 02:31, Igor Tandetnik wrote: On 12/8/2014 8:20 PM, Keith Medcalf wrote: update temp_table set id=(select id from some_table where c=42), operation='UPDATE' where exists (select 1 from some_table s where s.a=temp_table.a and s.b=temp_table.b and s.c=42); is the proper w

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Luuk
On 8-12-2014 21:17, Igor Tandetnik wrote: On 12/8/2014 3:08 PM, Luuk wrote: i hope this does it: update temp_table set id=(select id from some_table where c=42), operation='UPDATE' where exists (select 1 from some_table s, temp_table t where s.a=t.a and s.b=t.b); This u

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Luuk
On 8-12-2014 20:50, Venkat Murty wrote: How do I update multiple rows in a single sql statement. Two tables: create table some_table(id, a, b, c); create table temp_table (id, operation, a, b, c); Operation: Updating id, operation fields in temp_table if the record exists in some_table. with

Re: [sqlite] sqlite bugreport : unique index causes valid updates to fail

2014-12-08 Thread Luuk
On 8-12-2014 14:58, Gwendal Roué wrote: Le 8 déc. 2014 à 14:48, RSmith a écrit : On 2014/12/08 11:55, Gwendal Roué wrote: Hi, Unique indexes make some valid update queries fail. Please find below the SQL queries that lead to the unexpected error: -- The `books` and `pages` tables impleme

Re: [sqlite] Stuck and drowning trying to work out some SQL.

2014-11-01 Thread Luuk
On 1-11-2014 18:39, Igor Tandetnik wrote: On 11/1/2014 11:52 AM, Luuk wrote: Is the 'else null' part needed??, or can it be deleted Yes, it can be removed. CASE expression returns null when no case matches. Thanks for this co

Re: [sqlite] Stuck and drowning trying to work out some SQL.

2014-11-01 Thread Luuk
On 1-11-2014 15:30, Igor Tandetnik wrote: On 11/1/2014 8:24 AM, Clemens Ladisch wrote: Use correlated subqueries: SELECT Disruption_id, (SELECT MIN(Time_Event) FROM Table_1 AS T2 WHERE T2.Disruption_id = T1.Disruption_id ) AS Start_Time, (S

Re: [sqlite] 'INTEGER PRIMARY KEY' start value

2014-10-19 Thread Luuk
On 19-10-2014 17:48, Keith Medcalf wrote: for a table test(i integer primary key, j integer) the new i (rowid) is as follows: test.i = case when test.i is not null then test.i else case max(test.i) when null then 1 else max(test.i)+1 end end if you add the autoincrement keyword, then the al

Re: [sqlite] 'INTEGER PRIMARY KEY' start value

2014-10-19 Thread Luuk
On 19-10-2014 15:27, Baruch Burstein wrote: Is the rowid/'INTEGER PRIMARY KEY' field that is not entered manually guaranteed to start from 1? Or at least from a positive number? no C:\temp>sqlite3 SQLite version 3.8.4.3 2014-04-03 16:53:12 Enter ".help" for usage hints. Connected to a transie

Re: [sqlite] presentation about ordering and atomicity of filesystems

2014-09-13 Thread Luuk
On 13-9-2014 19:45, Simon Slavin wrote: On 13 Sep 2014, at 6:16pm, Tim Streater wrote: On 13 Sep 2014 at 16:39, Richard Hipp wrote: I say that a filesystem is an eventually-consistent key/value database. The keys are the filenames and the values are all big BLOBs, specifically the file con

Re: [sqlite] SQLite relative dates and join query help

2014-08-12 Thread Luuk
On 12-8-2014 19:38, Ben wrote: I'm trying to solve the following problem in SQLite: Items are being produced with a short, fixed shelf life. Say 50 days. Item can be collected every two weeks, where each item must be registered a week before. I am trying to create a query where I can list curr

Re: [sqlite] Not SQLite related, but, SQLite Mailing List related

2014-08-11 Thread Luuk
On 11-8-2014 19:19, Stephen Chrzanowski wrote: Ok, this IS NOT about SQLite itself in ANY regard, but specifically about this particular mailing list and how GMail is handling itself. When I joined this mailing list years ago, I put anything that goes through here into its own label via the same

Re: [sqlite] What am I doing wrong?

2014-08-09 Thread Luuk
On 8-8-2014 23:57, Errol Emden wrote: The SQL script you wrote actually provides the same information as mine - it lists all movies that Julie Andrews is in but it does NOT provide who is the leading actor in each movie, as all names selected is that of Julie Andrews. must have missed that ;-)

Re: [sqlite] What am I doing wrong?

2014-08-08 Thread Luuk
On 8-8-2014 20:35, Errol Emden wrote: I am to list the film title and the leading actor for all of the films 'Julie Andrews' played in. The following is structure of the tables used: movie(id, title, yr, director, budget, gross); actor(id, name); casting(movieid, actorid, ord). The column na

Re: [sqlite] Vacuum command fails

2014-07-17 Thread Luuk
On 17-7-2014 21:11, Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/07/14 10:42, veeresh kumar wrote: When i execute the command PRAGMA temp_store, it returned me 0. What is the ideal value that needs to be set? A quick google search would have found the answer: htt

Re: [sqlite] Help with SELECTing CASE problem

2014-05-31 Thread Luuk
On 31-5-2014 06:03, jose isaias cabrera wrote: "Luuk" wrote... On 30-5-2014 19:29, jose isaias cabrera wrote: "Igor Tandetnik" wrote... On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtr

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread Luuk
On 30-5-2014 19:29, jose isaias cabrera wrote: "Igor Tandetnik" wrote... On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtra4='y' What do you mean by "first record"? Records are processed in no particular order.

Re: [sqlite] Comments loss in sqlite_master table

2014-05-29 Thread Luuk
On 29-5-2014 11:00, Dan Kennedy wrote: On 05/29/2014 03:42 PM, big stone wrote: Hello, I miss the functionnality of some other sql motors that keep the comments inside an object definition, like a table. This sounds quite illogical, as : - Newlines and spaces are kept, (if not around

Re: [sqlite] Comments loss in sqlite_master table

2014-05-29 Thread Luuk
On 29-5-2014 10:42, big stone wrote: Hello, I miss the functionnality of some other sql motors that keep the comments inside an object definition, like a table. Example : (with sqlite.exe 3.8.3) create table /* This table has an educative purpose */ toto(x); create table /* This table has an e

Re: [sqlite] field length retreval

2014-04-18 Thread Luuk
On 18-4-2014 18:56, Simon Slavin wrote: On 18 Apr 2014, at 5:28pm, Dominique Devienne wrote: I'm not sure where you get that declaring a column as varchar() implicitly truncate While I can't find any reference one way or another in a SQL standard, all implementations I've seen that underst

Re: [sqlite] Out of memory error for SELECT char();

2014-03-08 Thread Luuk
On 8-3-2014 19:48, Simon Slavin wrote: On 8 Mar 2014, at 6:25pm, Zsbán Ambrus wrote: In the sqlite3 console, the following very simple statement gives "Error: out of memory": SELECT char(); I think this is a bug. 162:~ simon$ sqlite3 ~/Desktop/test.sqlite SQLite version 3.7.13 2012-07-17

Re: [sqlite] struggling with a query

2014-02-08 Thread Luuk
On 08-02-2014 11:58, big stone wrote: with sqlite 3.8.3 (for the with) : with v(vid,name) as (values (1,'foo'),(1,'bar'),(2,'bar'),(2,'baz')) select name, -max(case when vid=1 then 1 else 0 end ) + max(case when vid=2 then 1 else 0 end) from v group by name almost the same as thi

Re: [sqlite] Filtering a join

2014-01-31 Thread Luuk
On 31-01-2014 18:26, Joseph L. Casale wrote: use a 'inner join', in stead of a 'left join' ? Hi Luuk, Sorry for the ambiguity, let me clarify. Table A yields individual rows that I am interested in. For each of these rows, a one to many exists with table B and or C. In

Re: [sqlite] Filtering a join

2014-01-31 Thread Luuk
On 31-01-2014 17:23, Joseph L. Casale wrote: I have three tables where table A is a left joined one to many relationship against two other tables. I now need to modify this to accept filtering what is returned from table A based on one of the many rows in table B and/or C. The row from table A

Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Luuk
On 26-01-2014 17:09, Stephan Beal wrote: Hi, all, is there a syntactical construct which will allow me to use a pragma in a subselect? e.g. i'm trying to do... sqlite> pragma table_info(vfile); cid|name|type|notnull|dflt_value|pk 0|id|INTEGER|0||1 1|vid|INTEGER|0||0 ... sqlite> select name fro

Re: [sqlite] Command line shell not flushing stderr when interactive

2014-01-19 Thread Luuk
On 19-01-2014 19:59, Christopher Wellons wrote: When the shell is set to interactive (i.e. "-interactive"), the output (stdout) is flushed with every prompt (shell.c:422) but stderr is not. Stderr is suppose to be unbuffered so that flushing is not required. Or is that different for windows

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread Luuk
On 22-12-2013 08:55, Giuseppe Costanzi wrote: I don't know if I have understood well but the statment SUM(stats.quantity * (stats.which_month = 1)) SUM(stats.quantity * (stats.which_month = 2)) should be interpreted SUM stats.quantity IF stats.which_month = 1 is TRUE The original '(stats.wh

[sqlite] comiling sqlite.....

2013-11-30 Thread Luuk
Hi, i'm new at compiling stuff, and trying out some things... ;) I downloaded the sources last week (27nov) from http://www.sqlite.org/cgi/src/timeline?y=ci, and i got this file: SQLite-83c0bb9913838d18.tar.gz Question1: Is this the correct source for SQLite 3.8.2? or, How and where can i do

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-27 Thread Luuk
On 27-11-2013 03:55, James K. Lowden wrote: On Mon, 25 Nov 2013 19:44:15 +0100 Luuk wrote: On 25-11-2013 13:41, Simon Slavin wrote: I'm wondering whether there's an argument that it should be evaluated just once for a transaction. I'm still thinking about this question,

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-25 Thread Luuk
On 25-11-2013 13:41, Simon Slavin wrote: I'm wondering whether there's an argument that it should be evaluated just once for a transaction. I'm still thinking about this question, i can think of some benefits if its evaluated just once per transaction. but i hope anyone has some examples why

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-25 Thread Luuk
On 24-11-2013 19:36, Petite Abeille wrote: On Nov 24, 2013, at 7:10 PM, Valentin Davydov wrote: Wait a second... and you'll get different value of datetime('now'). In this sense datetime() is as deterministic as random(): it may give the same result next invocation or may not, dependng on var

Re: [sqlite] Insert with multiple nested selects.

2013-11-24 Thread Luuk
On 24-11-2013 17:10, Joseph L. Casale wrote: Hey guys, Trying to create a statement for use with parameters in a Python execute method when performing inserts with multiple nested selects. I can adjust it for use with Python, but I am having issues when there is more than one nested select. Some

Re: [sqlite] Is this a proper syntax?

2013-10-24 Thread Luuk
On 24-10-2013 21:23, Igor Korot wrote: Hi, ALL, Will this query work: UPDATE a SET a.field1 = (SELECT b.field1 FROM b AS myfield), a.field2 = myfield... or I will have to repeat subquery for a.field2? you only have to repeat the subquery if you want the new value of a.field2 to have the re

Re: [sqlite] sqlite .import bug

2013-09-07 Thread Luuk
On 07-09-2013 07:16, dmitry babitsky wrote: *This works fine:* echo 1 | sqlite dbfile ".import '/dev/stdin' foo" But if you have any character (like a space, or newline), or sql statement in front of the '.import', sqlite gives: "Error near "." syntax error *Why it matters:* * * Because what I

Re: [sqlite] UPDATE question

2013-09-07 Thread Luuk
On 07-09-2013 03:27, James K. Lowden wrote: On Fri, 6 Sep 2013 11:07:27 -0400 Richard Hipp wrote: The effect of early row updates might be visible in later row updates if you contrive a *sufficiently* complex example. But you really have to go out of your way to do that. sqlite> create tabl

Re: [sqlite] Anything like "select 7 as a, 8 as b, a / b as c; " possible whatsoever?

2013-07-21 Thread Luuk
On 21-07-2013 12:01, E.Pasma wrote: Op 21 jul 2013, om 11:27 heeft Mikael het volgende geschreven: Hi Igor, Ah I just noticed how you wrote your query and it delivers for it indeed. Here's an arbitrary example verifying its works. Neat - thanks! sqlite3 test.sqlite create table categories

Re: [sqlite] Anything like "select 7 as a, 8 as b, a / b as c; " possible whatsoever?

2013-07-20 Thread Luuk
On 20-07-2013 15:26, Mikael wrote: SELECT id, (SELECT thing FROM othertable WHERE othertable.something = categories.id) AS a, (SELECT thing2 FROM othertable2 WHERE othertable2.something2 = categories.id) AS b, a / b AS c FROM categories ORDER BY c; Is there any way whatsoever to do this? SE

Re: [sqlite] SQLite3 extended API usage

2013-07-06 Thread Luuk
On 06-07-2013 09:50, techi eth wrote: Hi,When i try to use extended API like sqlite_get_table(), i am getting undefined reference to function. How do i get it resolve ? I am following below link for API reference. http://www.sqlite.org/c_interface.html That link leads to: The C language inter

Re: [sqlite] Update statement

2013-05-07 Thread Luuk
On 07-05-2013 19:46, skywind mailing lists wrote: Hi, my question is: is it guaranteed that it works? Regards, Hartwig http://www.andrew.cmu.edu/user/shadow/sql/sql1992.txt chapter: 13.9 6) The s are effectively evaluated before updat- ing the object row. If a contains a ref

Re: [sqlite] How to generate graph through php-gd by get the data from sqlite database?

2013-03-16 Thread Luuk
On 16-03-2013 08:04, Newbie89 wrote: I found the example on how to generate graph using php-gd.Now I need the way that the php-gd connect with the sqlite database... http://w3schools.invisionzone.com/index.php?showtopic=47033&st=0&p=261288&#entry261288 ___

Re: [sqlite] Count(*) help

2012-09-16 Thread Luuk
On 16-09-2012 18:21, Marcus Ilgner wrote: On So, 2012-09-16 at 17:17 +0100, John Clegg wrote: I have a table Members with 896 rows and a text field "Year2012". It contains "Paid" 156 times, "Comp" 13 times and the rest are null (confirmed in sqlitebrowser as "empty") Back in the olden days when

Re: [sqlite] how to update the Moving average value

2012-08-12 Thread Luuk
On 12-08-2012 20:49, Klaas V wrote: Keith Metcalf wrote: id Sales_vol mov_avg 11 22 33 =(1+2+3)/3 45 =(2+3+5)/3 54 =(3+5+4)/3 62 =(5+4+2)/3 7 select id, sales_vol, (select avg(sales_vol) as mavg

Re: [sqlite] error group_concat

2012-06-16 Thread Luuk
On 16-06-2012 17:13, Black, Michael (IS) wrote: > Works in 3.7.9 > > > On my Windows 3.7.12 version it gets a segfault. > On my Unix 3.7.13 version I get the misuse of aggregate > > works in 3.7.11 too (Windows7): SQLite version 3.7.11 2012-03-20 11:35:50 Enter ".help" for instructions Enter

Re: [sqlite] copy table to another db file

2012-05-17 Thread Luuk
On 17-05-2012 11:04, YAN HONG YE wrote: > I have two db files: > > sqlite3 *db1; > sqlite3 *db2; > rc1 = sqlite3_open("myfile1", &db1); > rc2 = sqlite3_open("myfile2", &db2); > > I want to copy db1.table1 to db2 file, but I don't know how to do? sqlite myfile1 sqlite> attach database 'myfile2'

Re: [sqlite] Is it possible to inserted European accented strings(UTF-8/UTF-16) into SQLITE using SQLITE3.EXE?

2012-05-11 Thread Luuk
On 11-05-2012 19:47, Richard Hipp wrote: > On Fri, May 11, 2012 at 1:25 PM, Luuk wrote: > >> On 11-05-2012 19:11, Richard Hipp wrote: >>> On Fri, May 11, 2012 at 12:20 PM, Frank Chang >> wrote: >>> >>>> >>>> Good Afternoon, Is it poss

Re: [sqlite] Is it possible to inserted European accented strings(UTF-8/UTF-16) into SQLITE using SQLITE3.EXE?

2012-05-11 Thread Luuk
e was entered using the FireFox plugin.(http://code.google.com/p/sqlite-manager/) I like the result of this second attempt more.. So, question of OP remains ;) -- Luuk ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] ordering doesn't work the way I expected

2012-05-06 Thread Luuk
On 06-05-2012 20:28, Petite Abeille wrote: > > On May 6, 2012, at 8:18 PM, Luuk wrote: > >> So, if it is not defined how to sort column b, >> how can anyone correctly sort the column a? > > While the standard itself might well have nothing helpful to say about ho

Re: [sqlite] ordering doesn't work the way I expected

2012-05-06 Thread Luuk
On 06-05-2012 19:34, William Parsons wrote: > In my application, I've encountered a problem with ordering where the result > doesn't match what I would have expected, and would like some clarification. > The issue is illustrated by the following: > > % sqlite3 :memory: > SQLite version 3.7.10 201

Re: [sqlite] Fwd: Expression syntax

2012-04-30 Thread Luuk
On 30-04-2012 18:50, Pete wrote: > Anyone? > > -- Forwarded message -- > From: Pete > Date: Thu, Apr 26, 2012 at 10:55 AM > Subject: Expression syntax > To: sqlite-users@sqlite.org > > > The syntax diagram for an expression using the IN/NOT IN operators shows an > option to spec

Re: [sqlite] Bug? Empty string stored as NULL?

2012-03-08 Thread Luuk
On 08-03-2012 20:48, Marc L. Allen wrote: > Is that expected? To me, '' is different than NULL. > > create table a > ( > a text > ); > > insert into a select ''; > select * from a; > > Is there a way to store an empty string? > insert into a values(null); .nullvalue NULL sel

Re: [sqlite] Manual

2012-03-03 Thread Luuk
On 03-03-2012 17:12, Luuk wrote: > On 03-03-2012 17:08, Mark Schonewille wrote: >> Luuk, >> >> You're invited to write a good, simple explanation as to how to read those >> diagrams. >> >> -- > > Can you explain which part it is, you don't

Re: [sqlite] Manual

2012-03-03 Thread Luuk
On 03-03-2012 17:08, Mark Schonewille wrote: > Luuk, > > You're invited to write a good, simple explanation as to how to read those > diagrams. > > -- Can you explain which part it is, you don't understand? ___ sqlite-use

Re: [sqlite] Manual

2012-03-03 Thread Luuk
On 03-03-2012 16:43, Tim Streater wrote: > On 03 Mar 2012 at 15:15, Mark Schonewille > wrote: > >> MySQL has a really great manual with extensive explanations and dozens of >> examples for each command. SQLite is none of all this. It just has a limited >> number of pages listing a small number

Re: [sqlite] Manual

2012-03-03 Thread Luuk
On 03-03-2012 16:39, John Drescher wrote: > On Sat, Mar 3, 2012 at 10:15 AM, Mark Schonewille > wrote: >> Hi, >> >> MySQL has a really great manual with extensive explanations and dozens of >> examples for each command. SQLite is none of all this. It just has a limited >> number of pages listing

Re: [sqlite] Manual

2012-03-03 Thread Luuk
On 03-03-2012 16:15, Mark Schonewille wrote: > Hi, > > MySQL has a really great manual with extensive explanations and dozens of > examples for each command. SQLite is none of all this. It just has a limited > number of pages listing a small number of commands and some special features. > It al

Re: [sqlite] one table versus multiple

2012-02-26 Thread Luuk
On 26-02-2012 17:11, Luuk wrote: > On 26-02-2012 17:06, Rita wrote: >> if I can have a primary key of t+user (which would be ideal) how can I do a >> search? Can I do a key partial key scan in sqlite? For instance, give me >> the record for user 'foo' from time

Re: [sqlite] one table versus multiple

2012-02-26 Thread Luuk
On 26-02-2012 17:06, Rita wrote: > if I can have a primary key of t+user (which would be ideal) how can I do a > search? Can I do a key partial key scan in sqlite? For instance, give me > the record for user 'foo' from time 'x to y' ? select t, user, price from main where t between x and y and u

Re: [sqlite] How to get schema from attached database ?

2012-02-26 Thread Luuk
On 26-02-2012 06:58, 黃楨民 wrote: > Dear all: > I run sqlite3 In windows shell command environment and make a > connection to database in thw way like 『>sqlite3 dbone.sq3』. > Then, attach database 'dbtwo.sq3' as dbtwo. How could I get schema of detwo > under windows shell command ? > Please h

Re: [sqlite] How to find number of tables

2012-02-25 Thread Luuk
On 25-02-2012 18:02, inq1ltd wrote: > sqlite3 help, > > > Can someone tell me how to find the names of the tables that exist in a > database? > > I don't see it in the list of Pragma's > .help; you'll get a list of things, pick the right one ;) _

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-25 Thread Luuk
On 25-02-2012 11:30, Luuk wrote: > On 25-02-2012 11:16, Luuk wrote: >> On 24-02-2012 22:26, Steinar Midtskogen wrote: >>> [C M ] >>> >>>> For example, the average I'd >>>> want from these three timestamps: >>>> >>>> &#

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-25 Thread Luuk
On 25-02-2012 11:16, Luuk wrote: > On 24-02-2012 22:26, Steinar Midtskogen wrote: >> [C M ] >> >>> For example, the average I'd >>> want from these three timestamps: >>> >>> '2012-02-18 22:00:00.00' >>> '2012-02-19

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-25 Thread Luuk
2012-02-25 23:30:00 | +-+ select ADDTIME('07:00:00',TIME(AVG( CASE WHEN time(t)<'07:00:00' THEN addtime('24:00:00',time(t)) ELSE time(t) END))) AVERAGE from tijd; +-+ | AVERAGE | +-+ | 22:43:41.66 | +

Re: [sqlite] SQLite extensions repository

2012-02-12 Thread Luuk
On 12-02-2012 19:48, Marco Bambini wrote: > Hello, > I am wondering if there is there a place that collect all available sqlite > extensions. > > Please let me know. > Thanks. http://www.sqlite.org/contrib looks like a good place for it ;) ___ sqlite-

Re: [sqlite] SQLite libraries

2012-02-12 Thread Luuk
On 12-02-2012 19:15, Steinar Midtskogen wrote: > Hello > > Has anyone collected a library of extensions to SQLite, such as useful > aggregate functions, modules, etc? > > There is http://www.sqlite.org/contrib and extension-functions.c, but > is there more out there? > You can Google for: sqlit

Re: [sqlite] Using non-aggregate columns in group by (with an additional issue)

2012-01-13 Thread Luuk
le group by person order by > maxvalue desc) as y > where x.person = y.person > and x.value = y.maxvalue > > This works -- to an extent. I now see: Because it only works 'to an extent', try: select t1.person, max(t1.value), t2.timestamp fro

Re: [sqlite] How to insert control characters into a table

2011-12-31 Thread Luuk
Kai on a Windows-machine, this works: press, and keep pressed, the ALT-key, and type 10 on your numeric keypad while entering the symbol for '\r' you'll get : sqlite> select 'test◙abc'; ...> test abc sqlite> (i hope this looks good when process through som

Re: [sqlite] Export Blob data from sqlite database to html

2011-11-16 Thread Luuk
On 16-11-2011 10:02, si666 wrote: > I have a sqlite database from a iphone chat app which I would like to present > in a human readable format either csv, html or other. you should ask the author of that iphone app ;) ___ sqlite-users mailing list

Re: [sqlite] Referencing subquery several times

2011-11-12 Thread Luuk
ECT * FROM b) AS sfb : > SELECT * FROM m WHERE > c IN sfa OR > c IN sfb > AND (NOT c IN sfa > OR c IN sfb)); > > -- Darren Duncan It is not on the list of unsupported features: (http://www.sqlite.org/omitted.html) But SQlite does not have 'WITH' implemented -- Luuk ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Referencing subquery several times

2011-11-12 Thread Luuk
On 12-11-2011 12:12, Alexandre Courbot wrote: > Hi Igor, > > On Nov 12, 2011 11:45 AM, "Igor Tandetnik" wrote: >> This query doesn't make much sense. It appears that quite a few > conditions are redundant, or else the parentheses are in the wrong places. > What logic were you trying to express he

Re: [sqlite] Referencing subquery several times

2011-11-12 Thread Luuk
On 12-11-2011 03:43, Igor Tandetnik wrote: > On 11/11/2011 9:24 PM, Alexandre Courbot wrote: >> Here is a simplified version of the statement I try to run (let a, b, >> and m be tables with only one column named c containing integers): >> >> SELECT * FROM m WHERE >> c IN (SELECT * FROM a) OR >

Re: [sqlite] Documentation in PDF

2011-11-10 Thread Luuk
On 09-11-2011 12:29, Luuk wrote: On 08-11-2011 14:04, Arbol One wrote: Any one knows where I can get the documentation in http://www.sqlite.org/download.html, but in PDF format? TIA The main problem with this is that PDF is so much baes on a page layout, and HTML is not I tried to

Re: [sqlite] INDEX Types

2011-11-09 Thread Luuk
On 09-11-2011 20:14, Fabian wrote: 2011/11/9 Luuk On 09-11-2011 17:23, Black, Michael (IS) wrote: time sqlite3 $ time sqlite3 Did you do a reboot between the second insert? Because the difference I'm seeing is much larger than 38%? Did you test it on Linux or Windows? Linux (

Re: [sqlite] INDEX Types

2011-11-09 Thread Luuk
On 09-11-2011 17:23, Black, Michael (IS) wrote: time sqlite3 $ time sqlite3 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] null NULL nUlL

2011-11-09 Thread Luuk
t why this question? I mean why do you want to rely on it? It many cases it is much clearer to write every Keyword with capitals, avoiding typo's ;) -- Luuk ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Documentation in PDF

2011-11-09 Thread Luuk
'convert' the website into one large HTML (it a simple attempt, ;) see: http://q.x4all.nl/sqlite.html (1.5 Mb) and converted that HTML to PDF see: http://q.xs4all.nl/sqlite.pdf (2.6 Mb) (i used LibreOffice to convert it) --

<    1   2   3   >