Why cant you filter on Data1?
I meant select * from xxx where data2 <> 141 and data3 = 1 and (data1 = 7 or data1 = 5 or data1 = 2 or data1 = 4) groupby data1 -----Original Message----- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 10:51 AM To: MYSQL-List (E-mail) Subject: RE: Query Question I suppose I should have specified that I would not be able to filter by Data1 > -----Original Message----- > From: Mary Stickney [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 19, 2002 11:52 AM > To: Luc Foisy > Subject: RE: Query Question > > > > select * from xxx > where data2 <> 141 and data3 = 1 and (data3 = 7 or data3 = 5 > or data3 = 2 or > data3 = 4) > groupby data1 > > -----Original Message----- > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 19, 2002 10:32 AM > To: MYSQL-List (E-mail) > Subject: Query Question > > > > Some ficticious data > > ID Data1 Data2 Data3 > 1 1 141 1 > 2 5 140 1 > 3 4 142 1 > 4 3 141 1 > 5 2 142 1 > 6 5 142 1 > 7 7 140 1 > 8 2 143 1 > 9 3 142 1 > 10 3 143 1 > 11 4 144 1 > 12 2 144 1 > 13 8 141 2 > 14 9 140 2 > 15 6 142 2 > 16 11 141 2 > 17 0 142 2 > 18 9 142 2 > 19 10 140 2 > 20 0 143 2 > 21 11 142 2 > 22 3 143 2 > 23 6 144 2 > 24 0 144 2 > > 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 > > The return would include these values for Data1 > > 7 > 5 > 2 > 4 > > Is there some way to do this with a single query? > > If this is unclear, let me know > > Luc Foisy > > Technical Magic - www.technical-magic.com > 1 Stafford Road, Suite 325, Nepean, Ontario, K2H 1B9 > Phone: (613) 721-8850 Fax: (613) 596-5096 > E-Mail: [EMAIL PROTECTED] > > <<<<< Fulfilling the Promise of Technology >>>>> > > > --------------------------------------------------------------------- > 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 > > --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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