Re: [sqlite] How to recognize a sqlite database file?

2012-08-13 Thread Luis Mochan
In linux I use the command 'file yourfilenamehere' and I get as an answer something like 'yourfilenamehere: SQLite 3.x database' if it is an Sqlite3 database. Regards, Luis On Tue, Aug 14, 2012 at 09:57:33AM +0800, daedae11 wrote: > How can I judge whether a file is a database file? Is there a

[sqlite] Filling missing records

2012-07-16 Thread Luis Mochan
Suppose I have a time series in a table such as time|value 0|... 1|... 2|... 5|... 7|... where ... denotes some value. There are some missing values from the table, such as those corresponding to time=3,4,6 in my example. I need to insert the missing rows using 0 for the corresponding value. Is t

Re: [sqlite] record number after reordering

2012-07-16 Thread Luis Mochan
Thanks Igor, What are the pros and cons of this approach vs. using a temporal table as suggested by Keith? Best regards, Luis On Sun, Jul 15, 2012 at 06:50:44PM -0400, Igor Tandetnik wrote: > Luis Mochan wrote: > > I want to reorder a table and then group and average it's value

Re: [sqlite] record number after reordering

2012-07-15 Thread Luis Mochan
Thanks Keith! Creating a temporal table with it's own rowid solved the problem. Luis On Sun, Jul 15, 2012 at 10:48:32AM -0600, Keith Medcalf wrote: > How about: > > drop table if exists temp.ordered; > create temporary table ordered (a number not null); > insert into ordered select a from table o

[sqlite] record number after reordering

2012-07-15 Thread Luis Mochan
I want to reorder a table and then group and average it's values. I tried something similar to SELECT AVG(a) FROM (SELECT a FROM table ORDER BY a) group by ROWID/10; in order to take the average 'a' for groups of 10 succesive values. My example fails. To understand I tried SELECT ROWID FROM (SEL