Re: Is there a better way than this?

2009-12-28 Thread Tim Molter
Thanks for the replies! Chris, yeah, that's the first thing I tried. The problem though is that SQL statement also returns Row #2 (x=1, y=25) since y=25 is associated with both x=1 and x=2. I want it only to return row #3. As John said, it may not be possible with a simple SQL statement. My

Re: Is there a better way than this?

2009-12-28 Thread Michael Dykman
-Original Message- From: Chris W [mailto:4rfv...@cox.net] Sent: Sunday, December 27, 2009 6:02 PM To: Tim Molter Cc: mysql@lists.mysql.com Subject: Re: Is there a better way than this? Unless I am missing something, this should work. SELECT DISTINCT X FROM `A` WHERE Y IN (25) AND Y

RE: Is there a better way than this?

2009-12-28 Thread Gavin Towey
Cc: mysql@lists.mysql.com Subject: Re: Is there a better way than this? Unless I am missing something, this should work. SELECT DISTINCT X FROM `A` WHERE Y IN (25) AND Y NOT IN (24) Chris W Tim Molter wrote: I'm new to MySQL and I'm looking for some guidance. I have a table A, with two

Re: Is there a better way than this?

2009-12-28 Thread DaWiz
way than this? I'm new to MySQL and I'm looking for some guidance. I have a table A, with two columns X and Y with the following data: | X|Y| 1 24 1 25 2 25 2 26 3 27 I want my SQL query to return 2 following this verbose

Is there a better way than this?

2009-12-27 Thread Tim Molter
I'm new to MySQL and I'm looking for some guidance. I have a table A, with two columns X and Y with the following data: | X|Y| 1 24 1 25 2 25 2 26 3 27 I want my SQL query to return 2 following this verbose logic:

Re: Is there a better way than this?

2009-12-27 Thread John List
On 12/27/2009 06:04 PM, Tim Molter wrote: I'm new to MySQL and I'm looking for some guidance. I have a table A, with two columns X and Y with the following data: | X|Y| 1 24 1 25 2 25 2 26 3 27 I want my SQL query

Re: Is there a better way than this?

2009-12-27 Thread Chris W
Unless I am missing something, this should work. SELECT DISTINCT X FROM `A` WHERE Y IN (25) AND Y NOT IN (24) Chris W Tim Molter wrote: I'm new to MySQL and I'm looking for some guidance. I have a table A, with two columns X and Y with the following data: | X|Y| 1