MySQL Ver 8.41 Distrib 5.0.27 Intel Xeon 3.60 GHz 2.0 G of RAM Windows Server 2003 Service Pack 1
The following query will sometimes work and sometimes fail. When it fails it kills the mysqld service and requires it to be restarted. Sometimes if I add additional id's to the IN clause it will fail more often. select distinct(ct.truck_name), (SELECT OID FROM release2_85.cust_positions cp where cp.asset_id = ct.OID order by date_time desc LIMIT 1) as MAXPOSID, (SELECT date_add(date_time, interval -360 minute) FROM release2_85.cust_positions WHERE OID = MAXPOSID) as date_time, (SELECT location1distance / 1000 FROM cust_positions WHERE OID = MAXPOSID) as location1distance, (SELECT location1 FROM release2_85.cust_positions WHERE OID = MAXPOSID) as location1 FROM release2_85.cust_trucks ct where (SELECT OID FROM release2_85.cust_positions cp where cp.asset_id = ct.OID order by date_time desc LIMIT 1) is not null and ct.OID in (-1,1,2,104181,104182,104183) order by truck_name _____________________________________________________ William Nordin System Analyst / Programmer QA Technologies [EMAIL PROTECTED] (306) 931-6943 ext.265 NOTICE: This confidential e-mail message is only for the intended recipient(s). If you are not the intended recipient, be advised that disclosing, copying, distributing, or any other use of this message, is strictly prohibited. In such case, please destroy this message and notify the sender.