Weedpacket wrote:Select
t1.key1,
t1.field1-t2.field2 As fielddifference
From
table1 t1, table2 t2
Where
t1.key1=t2.key2
I wish it were that easy. The table info that I gave was purposely simplified for the sake of the thread. Perhaps I should've made note of that.
In actuality, I have two MYSQL arrays. The queries used to obtain them are identical, except for differing "WHERE" parameters. I could solve this with a subquery, but can't grasp the pre-MySQL 4.1 concept of them.
Here are the two actual queries, as they stand:
SELECT h.hintCategoryID AS hintCategoryID, COUNT(*) AS maxHints
FROM hint h
LEFT JOIN chosenhint ch USING (hintID)
WHERE h.questionID = ' ".$questionID." '
GROUP BY h.hintCategoryID;
SELECT h.hintCategoryID AS hintCategoryID, COUNT(*) AS hintsSelected
FROM hint h
LEFT JOIN chosenhint ch USING (hintID)
WHERE h.questionID = ' ".$questionID." '
AND ch.responseID = ' ".$responseID." '
GROUP BY h.hintCategoryID;