Mike U. Petrov wrote:
Hi every1!
Excuse me for maybe offtopic but I need help on mysql database.
I have 4 tables, and here are some important extractions from 'em:
objects{
object_id;
name;
}
users{
user_id;
nick;
date;
}
notes{
user_id;
ideas?
Mike U. Petrov
-Original Message-
From: Justin Patrin [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 10:53 AM
To: [EMAIL PROTECTED]
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
] Re: Very complex query
Mike U. Petrov wrote:
Hi every1!
Excuse me for maybe offtopic but I need help on mysql database.
I have 4 tables, and here are some important extractions from 'em:
objects{
object_id;
name;
}
users{
user_id;
nick;
date;
}
notes{
user_id
Subject: [PHP-DB] Re: Very complex query
Mike U. Petrov wrote:
Hi every1!
Excuse me for maybe offtopic but I need help on mysql database.
I have 4 tables, and here are some important extractions from 'em:
objects{
object_id;
name;
}
users{
user_id;
nick;
date;
}
notes
PROTECTED]
Subject: Re: [PHP-DB] Re: Very complex query
You can also DISTINCT command instead.
UNIQUE command isnot supported by mySQL (at least at MySQL 3.23.41- I am
using)
Hope this helps,
M.Mamedov
- Original Message -
From: Justin Patrin [EMAIL PROTECTED]
To: [EMAIL PROTECTED
. Do u have any other ideas?
Mike U. Petrov
-Original Message-
From: Justin Patrin [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 10:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Very complex query
Use unique(user_id). And please don't reply to a previous post when
posting
El Jue 11 Dic 2003 05:00, Muhammed Mamedov escribió:
You can also DISTINCT command instead.
UNIQUE command isnot supported by mySQL (at least at MySQL 3.23.41- I am
using)
UNIQUE is for table creation or index creation. It is relevent for insertion,
not selects.
DISTINCT and DISTINCT ON() are
El Jue 11 Dic 2003 05:17, Mike U. Petrov escribió:
No, DISTINCT isn't match my purpose cause of it rerurns unique rows but I
need ONE user_id per one object_id.
GROUP BY is your answer.
--
15:51:02 up 15 days, 22:07, 3 users, load average: 0.90, 0.75, 0.61
El Jue 11 Dic 2003 05:30, Mike U. Petrov escribió:
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...
Add it to the GROUP BY.
--
16:33:02 up 15 days, 22:49, 4 users, load average: 0.03,