Re: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Paul Smith
I can insert all rows of existing table into new table having same columns using query : Insert into NEWTABLE select * from OLDTABLE But I want all rows of NEWTABLE sorted by field No, So I used query Insert into NEWTABLE select * from OLDTABLE order by no desc But it is not giving me

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Ajay
you misinterpreted my problem, I want to add all rows of old table into new table but with sorted order I don't want to fire another query (select * from newtable order by desc no ) to give sorted rows, I want to insert all rows in sorted order into new table. -Original Message- From:

Re: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Brass Tilde
You can't do that. The 'Insert' may (I'm not sure..) insert the data into 'NEWTABLE' in the you misinterpreted my problem, I want to add all rows of old table into new table but with sorted order I don't want to fire another query (select * from newtable order by desc no ) to give sorted

Re: [sqlite] SQLite.NET in-memory database creation

2005-06-30 Thread Brass Tilde
Stupid question, but how can i create an in-memory database with SQLite.NET provider? When i use Data Source=:memory: i get an exception that the specified file isn't found. If you are using the ADOSQLiteDotNet provider from SourceForge, add New=True to your connection string.

Re: [sqlite] SQLite.NET in-memory database creation

2005-06-30 Thread Brass Tilde
Stupid question, but how can i create an in-memory database with SQLite.NET provider? When i use Data Source=:memory: i get an exception that the specified file isn't found. If you are using the ADOSQLiteDotNet provider from SourceForge, add New=True to your connection string. To

Re: [sqlite] SQLite.NET in-memory database creation

2005-06-30 Thread Peter Berkenbosch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter Berkenbosch wrote: Stupid question, but how can i create an in-memory database with SQLite.NET provider? When i use Data Source=:memory: i get an exception that the specified file isn't found. Can anyone explain to me how it is done ?

Re: [sqlite] SQLite.NET in-memory database creation

2005-06-30 Thread Peter Berkenbosch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brass Tilde wrote: Stupid question, but how can i create an in-memory database with SQLite.NET provider? When i use Data Source=:memory: i get an exception that the specified file isn't found. If you are using the ADOSQLiteDotNet provider from

Re: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread D. Richard Hipp
On Thu, 2005-06-30 at 16:35 +0530, Ajay wrote: So I used query Insert into NEWTABLE select * from OLDTABLE order by no desc But it is not giving me sorted output as new table? Can you tell me where I am wrong ??? The ORDER BY clause on a SELECT used to insert into a table has been

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Brad DerManouelian
The solution is to always specify an order when you want to return data in a particular order. SQL standard does not specify that rows come back in a particular order unless you specify. Order is never assumed as to enhance speed - especially for functions where order is irrelevant like totaling

Re: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Puneet Kishor
On Jun 30, 2005, at 7:21 AM, Ajay wrote: Yaa that's what I wanted to do , So what do you think what could be the solution for this ? well, as others have suggested, there is no solution for it. Or, at least no solution that you should bother with. The purpose of the database is not to

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Ajay
Seems to be top of my head, Is there any simple and sweet solution ? -Original Message- From: Brad DerManouelian [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 6:36 PM To: sqlite-users@sqlite.org; [EMAIL PROTECTED] Subject: RE: [sqlite] Insert all rows from old table into

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Brad DerManouelian
My apologies for being long-winded. Basically the answer is to not insert in a particular order and do your order by when you recall the data from NEWTABLE. Insert the data: Insert into NEWTABLE select * from OLDTABLE Then to get the data back in the order you want: select * from NEWTABLE order

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Ajay
Ok, it means that I can't do so ! -Original Message- From: Brad DerManouelian [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 7:33 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite] Insert all rows from old table into new table but in sorted order My apologies for being

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Steve O'Hara
Some databases do actually allow you to maintain an insertion order. They do this for performance reasons so that the high cost of sorting is avoided - we have a few newspaper databases (30 million full text stories) that have their primary key defined as the inverse story insertion date - this

Re: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Puneet Kishor
On Jun 30, 2005, at 9:47 AM, Steve O'Hara wrote: Some databases do actually allow you to maintain an insertion order. They do this for performance reasons so that the high cost of sorting is avoided - we have a few newspaper databases (30 million full text stories) that have their

RE: [sqlite] Insert all rows from old table into new table but in sorted order

2005-06-30 Thread Paul Smith
At 12:52 30/06/2005, you wrote: you misinterpreted my problem, I want to add all rows of old table into new table but with sorted order I don't want to fire another query (select * from newtable order by desc no ) to give sorted rows, I want to insert all rows in sorted order into new table.