Thanks Martin for the quick response.
However, that was the original query and that didn't work. I've even tried
using alias on that (SELECT error as x..... tt.error=x) to no avail.
I did tried setting the statement before to tt.error=error and that yields
me an output but the value of totalerror for the rest of the output rows are
always set to the first output (which shouldn't be the case).
Regards,
John
----Original Message Follows----
From: Martin Jenkins <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [sqlite] "no such column" problem with multi level sub queries
Date: Fri, 14 Jul 2006 12:46:26 +0100
MIME-Version: 1.0
Received: from sqlite.org ([67.18.92.124]) by bay0-mc2-f13.bay0.hotmail.com
with Microsoft SMTPSVC(6.0.3790.2444); Fri, 14 Jul 2006 04:48:31 -0700
Received: (qmail 23254 invoked by uid 1000); 14 Jul 2006 11:46:30 -0000
Received: (qmail 23246 invoked from network); 14 Jul 2006 11:46:28 -0000
X-Message-Info: LsUYwwHHNt3660MmjhEvYg2f34OAemlKtU9j2Z7TuGo=
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Id: SQLite Users Mailing List <sqlite-users.sqlite.org>
List-Post: <mailto:[email protected]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
Delivered-To: mailing list [email protected]
Organization: XQP Ltd
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
References: <[EMAIL PROTECTED]>
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 14 Jul 2006 11:48:32.0022 (UTC)
FILETIME=[6E308360:01C6A73B]
No doubt Igor or one of the others will be able to explain *why* your SQL
fails but changing line 1 from
> 1: SELECT testlog.error,
to
> 1: SELECT error,
works with Python 2.5 using the built-in sqlite (3.3.4) on XP and with
Python 2.4 and pysqlite (2.8.16) on Debian Sarge.
Martin
John Cruz wrote:
Apologies for the below statement:
Seems the culprit is line 5's testlog.error. It doesn't seem to see a 3
level deep SELECT. Running from line 2.
I was trying to modify the query line and forgot to clean my email. But
the statement about "3 level deep" stays. :-)
Thanks,
John
Hello folks,
Not sure if I'm doing this right or not but...
.. I'm trying to query the total occurence of an error on the last status
of the unit. Anyways, my table contains at least these fields: sn (serial
number), error (error code), testend (test time).
Right now I'm doing this query:
1: SELECT testlog.error,
2: (
3: SELECT count(*) FROM
4: (SELECT max(tt.testend) FROM testlog AS tt
5: WHERE tt.testend LIKE '2006/07/13%'
6: AND tt.error=testlog.error
7: GROUP BY tt.sn)
8: )
9: AS totalerror
10: FROM testlog WHERE testend LIKE '2006/07/13%'
11: GROUP by testlog.error;
from which I'm getting this error message...
"SQL error: no such column: testlog.error"