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
-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
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
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
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:
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
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