RE: Re: Very complex query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried to use GROUP BY and it worked almost right but i need to return
user_id and mysql generated an error that notes.user_id isn't used in GROUP
BY...

Mike U. Petrov


-----Original Message-----
From: Justin Patrin [mailto:papercrane@xxxxxxxxxxxxxxx]
Sent: Thursday, December 11, 2003 11:25 AM
To: php-db@xxxxxxxxxxxxx
Subject: Re:  Re: Very complex query


Mike U. Petrov wrote:

> First, sorry my starnge way to post new thread.
> Second:
> I want to specify some features:
> in my table notes I've a lot of user_id's for each object_id and I don't
> want to find unique user_id, I only want to find one user_id for each
> object_id, so unique(user_id) doesn't match. Do u have any other ideas?
>
> Mike U. Petrov
>
>
> -----Original Message-----
> From: Justin Patrin [mailto:papercrane@xxxxxxxxxxxxxxx]
> Sent: Thursday, December 11, 2003 10:53 AM
> To: php-db@xxxxxxxxxxxxx
> Subject:  Re: Very complex query
>
> Use unique(user_id). And please don't reply to a previous post when
> posting a new thread....it screws up threading.
>
> --
> paperCrane <Justin Patrin>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Oops, sorry about that. What you could do is:

GROUP BY object_id

or

GROUP BY object_id, other_field, other_field2, etc

Just don't group by user_id.

--
paperCrane <Justin Patrin>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux