From: flobee <fl...@gm...> - 2003-08-09 20:23:25
|
hello all! i´m working on a little tool to get some extra statistic informations about the respondents and the usage... i build a page with shows me the TOP lists of surverys, and respondents now i want the find out which respondent has not made or finished a survey to see it or to delete unused accounts (huge list!) but i really have troubles to find a right and simple mysql query to check this. i already ask in some mysql-communitys but havn´t got any resonse yet :-( the query to show all respondents with the last survey (but missing users with "no survey"): $sql = ("SELECT t1.* , max(t2.submitted) as mysort FROM respondent AS t1 , response AS t2 WHERE t1.realm='$realm' AND t1.username = t2.username GROUP BY t1.username ORDER BY mysort DSEC LIMIT 0, 50 "); i dont´find an working query to include all respondents even thouse who have not submitted any survey! mysql.com give an example but on my localhost i only get timeouts so that i can not find a good result/solution: mysql> SELECT table1.* FROM table1 -> LEFT JOIN table2 ON table1.id=table2.id -> WHERE table2.id IS NULL; This example finds all rows in table1 with an id value that is not present in table2 have you any idea to have a query which handle this!? kind regards flobee |