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"

Reply via email to