RE: [PHP-DB] Re: Very complex query
| From: | Mike U. Petrov | Date: | Thu, 11 Dec 2003 08:30:01 +0000 |
| Subject: | RE: [PHP-DB] Re: Very complex query | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31984@lists.php.net to get a copy of this message | ||
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@reversefold.com]
Sent: Thursday, December 11, 2003 11:25 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] 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@reversefold.com]
> Sent: Thursday, December 11, 2003 10:53 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] 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