Re: [sqlite] Need help with the SQL statement.

2009-04-15 Thread Joanne Pham
Hi Igor, 20657220  is number of minutes in GMT time zone. So we need to convert to second by 20657220 *60. select datetime(20657220*60, 'unixepoch','localtime' ); will be 2009-04-11 00:00:00 Thanks for the hlep Igor JP From: Igor Tandetnik To: sqlite-users@sql

Re: [sqlite] Need help with the SQL statement.

2009-04-15 Thread John Machin
On 16/04/2009 2:17 PM, Igor Tandetnik wrote: > "Joanne Pham" > wrote in message news:872428.4795...@web90308.mail.mud.yahoo.com >> But the first row (20657220 1 2 101 -- this is 2009-04-11 00:00:00) >> may not be there in the dailyDataTable so min(startTime) won't work >> in this case. Any idea Ig

Re: [sqlite] Need help with the SQL statement.

2009-04-15 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:872428.4795...@web90308.mail.mud.yahoo.com > But the first row (20657220 1 2 101 -- this is 2009-04-11 00:00:00) > may not be there in the dailyDataTable so min(startTime) won't work > in this case. Any idea Igor? I don't quite see how 20657220 can represent mi

Re: [sqlite] Need help with the SQL statement.

2009-04-15 Thread Joanne Pham
Thanks a lot for respond my email! But the first row (20657220 1 2 101 -- this is 2009-04-11 00:00:00) may not be there in the dailyDataTable so min(startTime) won't work in this case. Any idea Igor? Thanks JP From: Igor Tandetnik To: sqlite-users@sqlite.org S

Re: [sqlite] Need help with the SQL statement.

2009-04-15 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:594788.4966...@web90305.mail.mud.yahoo.com > Hi All, > I have the following table(dailyDataTable) as defined below > startTime INTEGER : number of minutes in GMT time > appId INTEGER : application Id > remoteId INTEGER : server id > proxyCount INTEGER > This tab

[sqlite] Need help with the SQL statement.

2009-04-15 Thread Joanne Pham
Hi All, I have the following table(dailyDataTable) as defined below   startTime INTEGER : number of minutes in GMT time   appId INTEGER  : application Id   remoteId  INTEGER : server id   proxyCount INTEGER This table can have up to 24 hours as below: (this table ca

Re: [sqlite] Mismatched columns in union can repeatably crash 2.6.10

2009-04-15 Thread D. Richard Hipp
On Apr 15, 2009, at 4:38 PM, Tom Sillence wrote: > I don't have all that much time to research whether this is a known > issue. > The following query crashes 2.6.10 every time, on linux and windows: > > create table crash(a,b); insert into crash select > 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 unio

Re: [sqlite] Mismatched columns in union can repeatably crash 2.6.10

2009-04-15 Thread Kees Nuyt
On Wed, 15 Apr 2009 21:38:04 +0100, Tom Sillence wrote: >I don't have all that much time to research whether this is a known issue. >The following query crashes 2.6.10 every time, on linux and windows: > >create table crash(a,b); insert into crash select >1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 union

Re: [sqlite] step() fails with SQLITE_BUSY afterBEGINEXCLUSIVETRANSACTION - SOLVED

2009-04-15 Thread mw
Thanks, Ken. I will check that out. -- Mario -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Ken Sent: Wednesday, April 15, 2009 10:13 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] step() fails with

[sqlite] Mismatched columns in union can repeatably crash 2.6.10

2009-04-15 Thread Tom Sillence
I don't have all that much time to research whether this is a known issue. The following query crashes 2.6.10 every time, on linux and windows: create table crash(a,b); insert into crash select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 union all select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,

Re: [sqlite] step() fails with SQLITE_BUSY after BEGINEXCLUSIVETRANSACTION - SOLVED

2009-04-15 Thread Ken
This may help: You can use the function to track all statements associated with a database connection. http://sqlite.org/c3ref/next_stmt.html --- On Wed, 4/15/09, m...@mwlabs.de wrote: > From: m...@mwlabs.de > Subject: Re: [sqlite] step() fails with SQLITE_BUSY after > BEGINEXCLUSIVETRANSA

Re: [sqlite] Aggregating BitFlags

2009-04-15 Thread Mark
Igor Tandetnik wrote: > Tristan Rhodes > wrote: >> In addition, I am trying to do this in .Net. I've had a look and it >> seems to only be available in PHP. > > It's definitely available in C. > >> Any way i can do this using the .Net framework? > > No clue, sorry. > > Igor Tandetnik If you

Re: [sqlite] How to calculate the size of my database for n records ?

2009-04-15 Thread John Machin
On 15/04/2009 11:50 PM, Nicolas Gaiffe wrote: > Thank you Igor. > > Does anyone have a clue about estimating the size of a database ? >> I'm quite new at sqlite and I need to estimate the size the database I am > creating could reach. >> Basically, estimating for any table how many bytes would b

Re: [sqlite] Aliased column can't use index outside of VIEWs?

2009-04-15 Thread John Machin
On 15/04/2009 11:40 PM, Kelly Jones wrote: > I have a hideous query that looks like this: > > SELECT anf.name AS child, anf2.name||anf3.name||anf4.name AS parent > [...] > WHERE child='albuquerque' AND parent='newmexico'; > > which takes forever to run. I'm guessing: no column names in your WHER

Re: [sqlite] How to calculate the size of my database for n records ?

2009-04-15 Thread Nicolas Gaiffe
Thank you Igor. Does anyone have a clue about estimating the size of a database ? > I'm quite new at sqlite and I need to estimate the size the database I am creating could reach. > Basically, estimating for any table how many bytes would be used for an average record. > I mainly use INTEGER and

[sqlite] Aliased column can't use index outside of VIEWs?

2009-04-15 Thread Kelly Jones
I have a hideous query that looks like this: SELECT anf.name AS child, anf2.name||anf3.name||anf4.name AS parent [...] WHERE child='albuquerque' AND parent='newmexico'; which takes forever to run. However, when I replace 'child' with 'anf.name' in the WHERE clause, it runs lightning fast (as expe

Re: [sqlite] step() fails with SQLITE_BUSY after BEGINEXCLUSIVETRANSACTION - SOLVED

2009-04-15 Thread mw
I've found the problem. It was caused by a pre-compiled statement in a third party library. Since the library was used by several threads now, the statement, compiled in the context of one thread, blocked the entire database when an attempt way made to use it from another thread. The programmer h

[sqlite] Add custom datatypes

2009-04-15 Thread Alexey Pechnikov
Hello! I did write ipv4 extension. This works with ip addresses in text and digital forms. I did build ip ranges as text strings same as select intpoolfrom('3232235777-3232235778'); ==>3232235777 select intpoolto('3232235777-3232235778'); ==>323223