On 19 Aug 2002, at 11:32, Luc Foisy wrote: > ID Data1 Data2 Data3 > 1 1 141 1 > 2 5 140 1 > 3 4 142 1 [snip] > For my return I only want a single instance of "Data1", so it will > most likely need be GROUP BY Data1 > > I would like those records to include the "group" that does not > contain a "Data2" value of 141 > > There is also a WHERE clause on "Data3" = 1
Maybe something like this? SELECT Data1 FROM table_name WHERE Data3 = 1 GROUP BY Data1 HAVING SUM(Data2 = 141) = 0; [Filter fodder: SQL] -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php