Thanks, but the table structure that I have to work with cannot be
changed. Any solution with the simple table I listed?
On Dec 14, 2006, at 9:30 AM, Rolando Edwards wrote:
Here onoe that should work.
It only uses a LEFT JOIN
It does not use Subqueries
It does not use DISTINCT
Here it is :
select min(A.id) id,A.color
from color_table A left join color_table B
on A.color=B.color and A.id<>B.id
group by A.color
order by rand();
Give it a Try !!!
----- Original Message -----
From: Dwalu Z. Khasu <[EMAIL PROTECTED]>
To: Chris Boget <[EMAIL PROTECTED]>
Cc: Rolando Edwards <[EMAIL PROTECTED]>, Brian Dunning
<[EMAIL PROTECTED]>, mysql@lists.mysql.com
Sent: Thursday, December 14, 2006 12:17:30 PM GMT-0500 US/Eastern
Subject: Re: Workaround for distinct?
On Thu, 14 Dec 2006, Chris Boget wrote:
=>>I tried this out this morning on MySQL 5.
=>> It works. Please try this in MySQL 4 and see.
=>
=>Unless I'm way off, I do not believe your solution will work in
4.x because
=>it doesn't support sub-queries...
=>
4.1 does. See http://dev.mysql.com/doc/refman/4.1/en/subqueries.html
--
- Dwalu
.peace
--
I am an important person in this world -
Now is the most important time in my life -
My mistakes are my best teachers -
So I will be fearless.
- Student Creed
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?
[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?
[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]