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.


Reply via email to