Re: [sqlite] Query locking up SQLite

2005-07-25 Thread David Fowler
this statement has an extra ; which may be the error. Another thought, when quoting string literals, it is better to use single quotes('), since double quotes(") means identifier --column name-- first, string literal second. John == Thanks for the very

Re: [sqlite] Query locking up SQLite

2005-07-25 Thread John LeSueur
David Fowler wrote: SQLite Version 3.2.2. Is this a bug, or is my SQL that bad? Query 1: SELECT * FROM table1, table2 WHERE (table1.value LIKE "%value%" AND table1.table2_id = table2.id); This query works perfectly, can't fault it. But when I do this, SQLite locks out (Command line interface,

Re: [sqlite] Query on multiple tables

2005-06-20 Thread Dennis Cote
Martin Gagnon wrote: Hi all, Using sqlite3 on QNX 6.3.0. I need to do a select query on 3 tables by binding them by their ID's. Something like: Select tbl1.ID, tbl1.fld1, tbl1.fld2 /*(15 fields total, all from tbl1)*/ from tbl1, tbl2, tbl3, where tbl1.ID=4 AND tbl1.ID=tbl2.ParentID AND

RE: [sqlite] Query on multiple tables

2005-06-17 Thread Martin Gagnon
Hi Marc-André, That's a much better way of doing this. Thanks! Martin P.S. Tes salutations sont rendues! -Original Message- From: Marc-Andre Gosselin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 16, 2005 19:47 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Query on multiple

Re: [sqlite] Query on multiple tables

2005-06-16 Thread Marc-Andre Gosselin
Hi Martin, You should try to use a JOIN instead of the WHERE clause. Like this : SELECT tbl1.ID, tbl1.fld1, tbl1.fld2 ... FROM tbl1 JOIN tbl2 ON tbl2.ParentID = tbl1.ID JOIN tbl3 ON tbl3.ParentID = tbl2.ID WHERE tbl1.ID = 4 Try that and tell me if that work for you. I've got a similar

Re: [sqlite] Query select....

2005-04-01 Thread Martins Mozeiko
And now tell us, which part of your problem relates to SQLite? :) -- Martins From: SKORPIO-INFO [EMAIL PROTECTED] Date: Fri, 1 Apr 2005 15:17:56 +0300 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Query select > ok :) > > I have resolved this problem: > > SLOT_SEARC

Re: [sqlite] Query select....

2005-04-01 Thread SKORPIO-INFO
ok :) I have resolved this problem: SLOT_SEARCH = BSS.execute("SELECT * FROM slot WHERE data_slot='01-04-2005' AND ((num_slot > "+str(contatore[1])+") AND (num_slot < "+str(contatore[0])+"))") Thanks SKORPIO-INFO ha scritto: Hi to all, I have the necessity to carry out a query that it must find

Re: [sqlite] Query on sorting (grouping, actually)

2004-05-24 Thread Kurt Welgehausen
This question comes up every couple of months or so. It's a basic misunderstanding of how grouping works. The answer in your case is select Visitor_ID, Action, Message, Timestamp from av2, (select Visitor_ID vid, max(Timestamp) mts from av2 where Action='I' or Action='O'

Re: [sqlite] Query optimization help

2004-02-02 Thread Rickard Andersson
The advice from Dr. Richard Hipp did the trick. I added a multi column index and now the query takes less than a tenth of a seconds. Thanks a lot for the help you guys! I was going to send this acknowledgement by replying to the message by Dr. Hipp, but for some reason I didn't receive it, so

Re: [sqlite] Query optimization help

2004-02-02 Thread D. Richard Hipp
Rickard Andersson wrote: I'm having some performance problems with queries looking like the following: SELECT DISTINCT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM topics

Re: [sqlite] Query optimization help

2004-02-01 Thread Greg Obleshchuk
Hi Richard, try this SELECT DISTINCT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM topics AS t ,

Re: [sqlite] Query problem

2004-01-21 Thread D. Richard Hipp
D. Richard Hipp wrote: Simon Berthiaume wrote: For those of you that tends to write complex queries, I noted that SQLite doesn't like when a table name follows a opening parenthesis in the FROM clause. The simplest fix for this would be to insert "SELECT * FROM" right after the "(" in the FROM

Re: [sqlite] Query problem

2004-01-21 Thread D. Richard Hipp
Simon Berthiaume wrote: For those of you that tends to write complex queries, I noted that SQLite doesn't like when a table name follows a opening parenthesis in the FROM clause. The simplest fix for this would be to insert "SELECT * FROM" right after the "(" in the FROM list. So, if the

Re: [sqlite] Query problem

2004-01-21 Thread Simon Berthiaume
For those of you that tends to write complex queries, I noted that SQLite doesn't like when a table name follows a opening parenthesis in the FROM clause. For example, the following works under Access ans Oracle, but not in SQLite: SELECT T0.OBJECTS_ID , T0.OBJECTS_REFNO,

Re: [sqlite] Query problem

2004-01-19 Thread Kurt Welgehausen
If you look at the SQLite grammar in lang.html, you'll see that parentheses are not allowed around a table-list. That's why you're getting an error. If you remove either of the first 2 left parens (and its corresponding right paren), the query will work, but the outer select and the first

Re: [sqlite] Query problem

2004-01-19 Thread Simon Berthiaume
Actualy none, there was an error in the statement I copied. But the following works on Access (ADO) and Oracle as well, but not on SQLite. Since I don't have access to any other RDBMS, I couldn't test others. SELECT * FROM ( ( SELECT * from INSCLAIMS ) AS T0 LEFT JOIN

Re: [sqlite] Query problem

2004-01-19 Thread D. Richard Hipp
Simon Berthiaume wrote: SELECT * FROM ( ( SELECT * from INSCLAIMS ) AS T0 LEFT JOIN ( SELECT * FROM INSCLAIMS_CONCAT WHERE ( INSCLAIMS_CONCAT_FIELD_ID = 'INSCLAIMS_POLICYNO' ) ) AS T1 ON T1.INSCLAIMS_ID =

<    2   3   4   5   6   7