1 column - 2 column join optimisation

2003-02-06 Thread James Pharaoh
Hi, I'm trying to optimize the following query: SELECT * FROM user LEFT JOIN history ON user.userid = history.touserid OR user.userid = history.fromuserid WHERE user.state = 'ready' GROUP BY user.userid This causes a full table scan on the second table. If I do the following however the index is

Counting multiple tables

2003-03-14 Thread James Pharaoh
Hi, I'm trying to do a SELECT which then counts records in two separate tables, eg: SELECT a_id, count(b_id) FROM a LEFT JOIN b USING(a_id) merged with SELECT a_id, count(c_id) FROM a LEFT JOIN c USING(a_id) So you would end up with a_id, count(b_id), count(c_id) Showing the number of records l

MySQL / MS Access subforms

2002-03-13 Thread James Pharaoh
Hi, I've been migrating an MS Access database from Access to use a MySQL linked-table backend. Most problems have been fixed by the advice on the MyODBC FAQ and other resources but I am having trouble with a sub form to which I cannot find an answer... The database is a customers/stock/orders da