Using RANDOM before GROUP BY technique returned only a single column

Using RANDOM before GROUP BY technique returned only a single column

am 07.07.2009 02:57:09 von Highviews

--000e0cd1480259495f046e131b84
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,
I am using a technique described here at:
http://forums.mysql.com/read.php?20,227102,227102#msg-227102

To make results Random before applying the GROUP BY method.
The query to my table structure is this:

SELECT r.physicians_id,
(SELECT r1.id FROM physicians_images r1 WHERE
(r.physicians_id=r1.physicians_id AND procedures LIKE '%8%' AND category =
'beforeafter' AND publish = 1) ORDER BY rand() LIMIT 1) AS 'id' FROM
physicians_images r
GROUP BY r.physicians_id ;


I have the following columns:
id, physicians_id, imageName, imagePath, title, imageDetails, DateTime,
publish, Date, ip, category, site, patientName and procedures


The query is working well, but it only returned the ID, not the whole row.
How can i get the complete rows in results?

I tried using * but its returning with the following error:
#1241 - Operand should contain 1 column(s)


Any help??


Thanks!

---
http://www.visualbooks.com.pk/

--000e0cd1480259495f046e131b84--