Hmmm.  I would think these would do two different things:

-----
WHERE (x, y) IN (SELECT a, b FROM otherTable)
-----

and

-----
WHERE x IN (SELECT a FROM otherTable)
AND
y IN (SELECT b FROM otherTable)
-----

The first WHERE means that x and y must match a and b from the same
record.

The second WHERE means that x must match a and y must match b, but not
necessarily from the same record.

M!ke 

-----Original Message-----
From: Mark A Kruger [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 15, 2006 9:08 AM
To: CF-Talk
Subject: RE: Okay, here's *another* error message I've never seen...

Whoa.... Nice... Never thought of that. I would have done where x in
(blah) and y in (blah)... As usual Jochem you are the SQL king. 

-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Sunday, May 14, 2006 7:54 AM
To: CF-Talk
Subject: Re: Okay, here's *another* error message I've never seen...

Rick Root wrote:
> Bryan Stevenson wrote:
>> sub-queries can only return one record....thus the error
> 
> Actually Bryan, that's not true.  Sub-queries can only return one
column.

They can return more then one column too:

SELECT * FROM table
WHERE (x, y) IN (SELECT a, b FROM otherTable)

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240576
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to