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
----Original Message Follows----
From: "John Cruz" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [email protected]
Subject: [sqlite] "no such column" problem with multi level sub queries
Date: Thu, 13 Jul 2006 20:28:22 -0700
MIME-Version: 1.0
X-Originating-IP: [198.95.226.224]
X-Originating-Email: [EMAIL PROTECTED]
X-Sender: [EMAIL PROTECTED]
Received: from bay0-mc3-f19.bay0.hotmail.com ([65.54.244.91]) by
bay0-imc2-s38.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Thu,
13 Jul 2006 20:32:19 -0700
Received: from sqlite.org ([67.18.92.124]) by bay0-mc3-f19.bay0.hotmail.com
with Microsoft SMTPSVC(6.0.3790.2444); Thu, 13 Jul 2006 20:32:18 -0700
Received: (qmail 14086 invoked by uid 1000); 14 Jul 2006 03:28:54 -0000
Received: (qmail 14079 invoked from network); 14 Jul 2006 03:28:54 -0000
X-Message-Info: LsUYwwHHNt3660MmjhEvYg2f34OAemlK+3Wz9fWrJ/U=
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]
X-OriginalArrivalTime: 14 Jul 2006 03:28:23.0717 (UTC)
FILETIME=[8FD88D50:01C6A6F5]
Return-Path: [EMAIL PROTECTED]
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"
Digging deeper, seems like the error is coming from line 6. Anything I'm
doing wrong here? If I'm doing this wrong, let me know an alternative query
as well.
Seems the culprit is line 5's testlog.error. It doesn't seem to see a 3
level deep SELECT. Running from line 2.
Any help is greatly appreciated.
Thanks,
John C.