Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-29 Thread David Bicking
If Uniform has a given EmployeeName twice, you will get the Employee.Name twice in this query. Thus it would be a different result than if you did not join with Uniform. David From: Charles Samuels To: General Discussion of SQLite

Re: [sqlite] Why can't sqlite disregard unused outer joins?

2012-05-29 Thread Igor Tandetnik
On 5/29/2012 8:21 PM, Charles Samuels wrote: Suppose you have a query like this: select Employee.name from Employees left join Uniform on (EmployeeSize.name=Uniform.employeeName) Doesn't look like a valid query to me. What's Employee and EmployeeSize? I assume you meant Employees in

Re: [sqlite] How to write and read the same sqlite3 DB in memory concurrently in two thread?

2012-05-29 Thread Keith Medcalf
> And that explanation along with why one would want to use each mode would be > quite helpful to the community I would think. >From examining the source I see that it the serialization is via the mutex >attached to the database connection. Serialization of statements is achieved >by reference

[sqlite] Why can't sqlite disregard unused outer joins?

2012-05-29 Thread Charles Samuels
Suppose you have a query like this: select Employee.name from Employees left join Uniform on (EmployeeSize.name=Uniform.employeeName) This query's result should be identical weather or not we have that join; it's an outer join, not an inner join, afterall. However, explain query plan

Re: [sqlite] Improving performance of GROUP BY

2012-05-29 Thread Simon Slavin
On 29 May 2012, at 11:04pm, Nico Williams wrote: > Can you post EXPLAIN QUERY PLAN output for your statements? And/or your > schema. Also perform the SQL command 'ANALYZE' on that database, then try your timings again. See if the timings improve (or perhaps even get

Re: [sqlite] Improving performance of GROUP BY

2012-05-29 Thread Nico Williams
On Fri, May 25, 2012 at 1:38 PM, Udi Karni wrote: > I am running the following query - > > CREATE TABLE XYZ AS > SELECT ID, MIN (DATE) > FROM SOURCE-TABLE > WHERE CRITERIA > GROUP BY ID ; > > SOURCE-TABLE has 600 million rows, 2 million meet the WHERE criteria, and > get grouped

Re: [sqlite] rearranging 2 fields into 1 based on an order indicator in 2 other fields

2012-05-29 Thread Igor Tandetnik
On 5/29/2012 4:44 PM, Gert Van Assche wrote: I have a strange table like this rowid; Field1x; Field2y; FieldAx; FieldBy 1; A; a; 0; 1 2; B; b; 4; 2 and I would need this: rowid; Field3; FieldC 1; A; 0 2; a; 1 3; b; 2 4;

Re: [sqlite] rearranging 2 fields into 1 based on an order indicator in 2 other fields

2012-05-29 Thread David Bicking
Create Table table2 (Field3, FieldC); insert into table2 (Field3, FieldC) Select Field1x, FieldAx from Table1; insert into table2 (Field3, FieldC) Select Field2y, FieldBy from Table1; this will put your data in to the new table. I suspect the rowids won't match what you want, but you can always

[sqlite] rearranging 2 fields into 1 based on an order indicator in 2 other fields

2012-05-29 Thread Gert Van Assche
All, I have a strange table like this rowid; Field1x; Field2y; FieldAx; FieldBy 1; A; a; 0; 1 2; B; b; 4; 2 and I would need this: rowid; Field3; FieldC 1; A; 0 2; a; 1 3; b; 2 4; B; 4 So: - the contents of

Re: [sqlite] how to merge data from fields... if this is possible.

2012-05-29 Thread Petite Abeille
On May 29, 2012, at 8:12 PM, Pavel Ivanov wrote: > It's obeyed after aggregation. So the same query with GROUP BY won't > work. Although one might write something like this: According to the fine manual [1]: "The order of the concatenated elements is arbitrary." [1]

Re: [sqlite] Cascade deletes in .Net FW 4 + EF

2012-05-29 Thread Kevin Benson
On Tue, May 29, 2012 at 9:26 AM, Peter Litsegård wrote: > Hi! > > I have a very simple database hsoted by SQLite v1.0.80.0. I'm struggling > to get cascade deletes to work using EF. I have set the OnDelete to > 'Cascade' on the "one end" but it fails to execute. Is this a

Re: [sqlite] how to merge data from fields... if this is possible.

2012-05-29 Thread Pavel Ivanov
> SELECT group_concat(fieldB,' ') FROM myTable WHERE fieldA = 'val1' ORDER BY > rowid > > Might get one of the values you wanted.  One concern is that I don't remember > whether the ORDER BY clause is obeyed before or after aggregation. It's obeyed after aggregation. So the same query with

Re: [sqlite] how to merge data from fields... if this is possible.

2012-05-29 Thread Black, Michael (IS)
Does this do what you want? create table t1(rowid,fieldA,fieldB); insert into t1 values(1,'val1','This is a'); insert into t1 values(2,'val1','small'); insert into t1 values(3,'val1','test.'); insert into t1 values(4,'val2','The proof is in'); insert into t1 values(5,'val2','the pudding.');

Re: [sqlite] how to merge data from fields... if this is possible.

2012-05-29 Thread Simon Slavin
On 29 May 2012, at 6:24pm, Gert Van Assche wrote: > I have a dataset that looks like this: > > rowid ; fieldA ; fieldB > 1 ; val1 ; This is a > 2 ; val1 ; small > 3 ; val1 ; test. > 4 ; val2 ; The proof is in > 5 ; val2 ; the pudding. > > >

[sqlite] how to merge data from fields... if this is possible.

2012-05-29 Thread Gert Van Assche
All, I have a dataset that looks like this: rowid ; fieldA ; fieldB 1 ; val1 ; This is a 2 ; val1 ; small 3 ; val1 ; test. 4 ; val2 ; The proof is in 5 ; val2 ; the pudding. And I would like to merge all values in fieldB when the value in fieldA is the same.

[sqlite] Documentation glitch: Repeated "or" ...

2012-05-29 Thread Ralf Junker
... at both end and beginning of these lines: http://www.sqlite.org/src/artifact/45a846045ddb8c4318f2919f3a70f011df5ca783?ln=2584-2585 Ralf ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Question about multi-threading with a read-onlydatabase

2012-05-29 Thread Mohit Sindhwani
Hi Simon, On 29/5/2012 7:36 PM, Simon Slavin wrote: It might be worth pointing out that the creator of SQLite feels that threads are evil. In fact it's in the FAQ, together with a pointer to the standard work on the subject (which I have never managed to understand all the way through):

[sqlite] Use with asp.net

2012-05-29 Thread Mike
I'd like to use a SQLite db as a back end for asp.net web pages. Is there information somewhere on how to deploy it and set it up? I gather I need to use system.data.sqlite.dll. That's the part I'm most interested in. ___ sqlite-users mailing list

Re: [sqlite] Cascade deletes in .Net FW 4 + EF

2012-05-29 Thread Simon Slavin
On 29 May 2012, at 2:26pm, Peter Litsegård wrote: > I have a very simple database hsoted by SQLite v1.0.80.0. I'm struggling to > get cascade deletes to work using EF. I have set the OnDelete to 'Cascade' on > the "one end" but it fails to execute. Is this a known

Re: [sqlite] How to write and read the same sqlite3 DB in memory concurrently in two thread?

2012-05-29 Thread Black, Michael (IS)
And that explanation along with why one would want to use each mode would be quite helpful to the community I would think. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems

Re: [sqlite] How to write and read the same sqlite3 DB in memory concurrently in two thread?

2012-05-29 Thread Pavel Ivanov
> Multi-thread -- one sqlite3 object per thread is required -- no sharing of > prepared statements or anything else. This is not true. Sharing of prepared statements and sqlite3 object is allowed in this mode as long as any access to them is protected by mutex or any other synchronization

Re: [sqlite] How to write and read the same sqlite3 DB in memory concurrently in two thread?

2012-05-29 Thread Black, Michael (IS)
This seems to fly in thte face of what I remember reading on here before. Can we get a clear explanation of what to do with the different THREADSAFE settings? I think it's implied... i.e. (assumign this is correct) Single-thread -- no threading allowed at all Multi-thread -- one sqlite3

[sqlite] Cascade deletes in .Net FW 4 + EF

2012-05-29 Thread Peter Litsegård
Hi! I have a very simple database hsoted by SQLite v1.0.80.0. I'm struggling to get cascade deletes to work using EF. I have set the OnDelete to 'Cascade' on the "one end" but it fails to execute. Is this a known issue? Are there any workarounds? Thanks!

Re: [sqlite] How to write and read the same sqlite3 DB in memory concurrently in two thread?

2012-05-29 Thread Pavel Ivanov
> How to write and read the same sqlite3 DB in memory concurrently in two > thread? You need to use one connection (sqlite3 object) and not to use SQLITE_OPEN_NOMUTEX flag (assuming you used default SQLite compilation options) or protect access to sqlite3 object with your own mutex. Pavel On

[sqlite] 'Illegal mnemonic' error during compiling sqlite on the opensolaris

2012-05-29 Thread Anatolii.Apanasiuk
Hi, I have this error: o===|-=-==|=o Starting build sqlite-amalgamation: [/var/tmp/build_svn-16470] Assembler: sqlite3.c "/var/tmp/build_svn-16470/ccrUHYTt.s", line 1543 : Illegal mnemonic Near line: "filds (%esp)"

Re: [sqlite] Update Query

2012-05-29 Thread Pavel Ivanov
On Tue, May 29, 2012 at 6:05 AM, IQuant wrote: >>CREATE VIEW TICKMAX >>AS >> SELECT ASK, BID, TRADEPRICE, TIMESTAMP, SYMBOL >>    FROM TICKDATA >>   WHERE TIMESTAMP = MAX(TIMESTAMP) >>GROUP BY SYMBOL; > > Trying to work through your suggestions: > I'm getting "Misuse of

Re: [sqlite] FW: Problem with SQLite when deployed.

2012-05-29 Thread Peter Walburn
Richard, Thanks very much. That now works with the latest version of SQLite. I had to include the Microsoft Visual C++ 2010 Redistributable package. Brilliant! Peter Walburn Software Engineer E-mail: peter.walb...@omega-data.com Units 44-46 Howe Moss Avenue, Kirkhill Industrial Estate,

Re: [sqlite] SQLite Database Password Recovery

2012-05-29 Thread Simon Slavin
On 29 May 2012, at 12:16pm, malaris wrote: > Hi, i am using sqlite database. > > a week ago i have encrypted using password. > > Now i forgot the password. how can i break the password ? > > is there any tool available to recover the database password ? Contact the

Re: [sqlite] Question about multi-threading with a read-onlydatabase

2012-05-29 Thread Simon Slavin
On 29 May 2012, at 8:00am, Mohit Sindhwani wrote: > Hi Igor, > > [snip] > > Thank you very much for the clarification. I guess we'll move to the > multi-threaded mode in a later release. It might be worth pointing out that the creator of SQLite feels that threads are evil.

[sqlite] SQLite Database Password Recovery

2012-05-29 Thread malaris
Hi, i am using sqlite database. a week ago i have encrypted using password. Now i forgot the password. how can i break the password ? is there any tool available to recover the database password ? -- View this message in context:

Re: [sqlite] Update Query

2012-05-29 Thread IQuant
Keith, Trying to work through your suggestions: I'm getting "Misuse of aggregate max()" >CREATE VIEW TICKMAX >AS > SELECT ASK, BID, TRADEPRICE, TIMESTAMP, SYMBOL >FROM TICKDATA > WHERE TIMESTAMP = MAX(TIMESTAMP) >GROUP BY SYMBOL; ___