[sqlite] Selecting row containing max value

2004-01-01 Thread Bronislav Klučka
Hi, I've got a table "state" which holds states for products, every insert made on this table is inserting values and value called "whenaction" where is the time (as timestamp) of the insert, so table cound look like this: id|amount|product_id|whenaction 1 50 2 115621 2 45 2

RE: [sqlite] Date problem

2004-01-01 Thread KL Chin
Hi D. Richard Hipp, After read the document, I still no sure how can I import/convert from the other Database's data using these command sets. For example if I wanted to import data from CSV, with the date format of MM/DD/YY, how the query statement like, if I want to insert to SQLite with the Da

RE: [sqlite] Date problem

2004-01-01 Thread KL Chin
Hi D. Richard Hipp, Thx for ur help. Regards KL Chin -Original Message- From: D. Richard Hipp [SMTP:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 11:38 AM Cc: '[EMAIL PROTECTED]' Subject:Re: [sqlite] Date problem KL Chin wrote: > > Is that away to have a "DATE" compa

Re: [sqlite] Date problem

2004-01-01 Thread D. Richard Hipp
KL Chin wrote: Is that away to have a "DATE" comparison inside SQLite? Or any expression to convert DATE to integer in SQLite? I mean, I don;t have to worry about data migration from other database. http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions -- D. Richard Hipp -- [EMAIL PROTECTED] -

RE: [sqlite] Date problem

2004-01-01 Thread KL Chin
Hi Michael, Thx for your reply. I do understand SQLite is typeless. Infact I have already done the /MM/DD format. Is that away to have a "DATE" comparison inside SQLite? Or any expression to convert DATE to integer in SQLite? I mean, I don;t have to worry about data migration from other data

Re: [sqlite] Date problem

2004-01-01 Thread Michael A. Cleverly
On Fri, 2 Jan 2004, KL Chin wrote: > Can anyone help on this problem, why with the query below > > DELETE FROM ABC WHERE datein < '12/29/03'; > > All my record date from '1/1/04' to '1/6/04' were delete. > Where datein was date type. SQLite is typeless, see: http://www.sqlite.org/datatypes.html

[sqlite] Date problem

2004-01-01 Thread KL Chin
Hi, Can anyone help on this problem, why with the query below DELETE FROM ABC WHERE datein < '12/29/03'; All my record date from '1/1/04' to '1/6/04' were delete. Where datein was date type. How Regards KL Chin - To unsubsc

[sqlite] tcl array for query results

2004-01-01 Thread Kurt Welgehausen
I've just discovered (perhaps everyone else already knew) that tcl arrays used to hold query results are not cleared before they're used. If the same array is used repeatedly, it can get quite large and affect execution time. More details are at . Th

Re: [sqlite] Find a row

2004-01-01 Thread [EMAIL PROTECTED]
Date sent: Thu, 01 Jan 2004 23:42:17 +0100 To: [EMAIL PROTECTED] From: Hennie Peters <[EMAIL PROTECTED]> Subject:Re: [sqlite] Find a row > to get the number of rows: > select count(*) from testtableint; > or the next on might be

Re: [sqlite] Find a row

2004-01-01 Thread Hennie Peters
to get the number of rows: select count(*) from testtableint; or the next on might be quicker: select count(1) from testtableint; How can you be sure that the first row contains the lowest rowid when doing: "select rowid,. from testtableint where rowid>2 limit 1" Would you need to do: "select r

Re: [sqlite] Find a row

2004-01-01 Thread [EMAIL PROTECTED]
> > Is it really much quicker than: > select min(rowid) from testtableint having rowid>2; > and is there a way to show the time a query takes to execute ? I guess this what you mean: select min(rowid) from testtableint where rowid>2 because having can only be used together with "group by" I thin

Re: [sqlite] Find a row

2004-01-01 Thread Hennie Peters
At 08:14 1-1-2004 -0500, D. Richard Hipp wrote: [EMAIL PROTECTED] wrote: What I am searching for is when I retrieved Row 2, I want to go to Row 3, and find an efficient way to do this. What I tried is this First go to Row 2, doesn't matter how, but I found the RowID belonging to Row 2 I want to d

Re: [sqlite] Find a row

2004-01-01 Thread D. Richard Hipp
[EMAIL PROTECTED] wrote: What I am searching for is when I retrieved Row 2, I want to go to Row 3, and find an efficient way to do this. What I tried is this First go to Row 2, doesn't matter how, but I found the RowID belonging to Row 2 I want to do (what is called in Delphi way of data-access

[sqlite] Find a row

2004-01-01 Thread [EMAIL PROTECTED]
First, a happy newyear to all!!! I have a question /problem, which I hope someone can find an answer / solution to. It is about rowid Let's say I have a table looking like this rowid, rest 1, . 2, 3, 4, 5, 6, 7, I delete the row wh