Re: Table update

2007-01-20 Thread Jørn Dahl-Stamnes
On Saturday 20 January 2007 05:52, ViSolve DB Team wrote:
 Hi

 Update will never support group by clause, only supports group functions;
 Try as:

 Update teams t
 inner join rider_team as rt on (rt.team_id=t.id)
 inner join participants as p on (p.rider_id=rt.rider_id)
 inner join races as r on (r.id=p.race_id)
 set t.created =  ( select min(starttime) from races);

Thanks, it worked, but all get the same date. So the result is not correct.

I want something like this (pseudo code):

for each $id in teams
{
  set teams.created = select min(r.starttime)
  from races as r on (r.id=p.race_id)
  inner join participants as p on (p.rider_id=rt.rider_id)
  inner join rider_team as rt where rt.team_id=$id
}

I guess that I have to do this in a perl script? But I would like to be able 
to do this with a SQL line.

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL Administrator problem

2007-01-20 Thread Kevin Spencer

On 1/19/07, Daniel Culver [EMAIL PROTECTED] wrote:

Are you working on a Mac? If so, logging in as root is not good
enough. You must have set up and log into the root user account of
your Mac computer or server.


The OP is talking about managing MySQL accounts with MySQL
Administrator.  MySQL Administrator does not in any way allow you to
login to a host with a shell account, root or otherwise.

--
Kevin.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL Administrator problem

2007-01-20 Thread Daniel Culver
Actually on my Mac; 10.4.6 ppc the MySQL Administrator will only open  
to a connection through localhost. The localhost connection will  
accept any authorised user to connect, but, MySQL Administrator will  
only assume the privileges of the account I am working from (I have  
several). It has been this way for a couple of years and through a  
few upgrades; it very well could be that I have something configured  
or installed wrong. What do you think?

Daniel Culver
[EMAIL PROTECTED]



On Jan 20, 2007, at 7:04 PM, Kevin Spencer wrote:


On 1/19/07, Daniel Culver [EMAIL PROTECTED] wrote:

Are you working on a Mac? If so, logging in as root is not good
enough. You must have set up and log into the root user account of
your Mac computer or server.


The OP is talking about managing MySQL accounts with MySQL
Administrator.  MySQL Administrator does not in any way allow you to
login to a host with a shell account, root or otherwise.

--
Kevin.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql? 
[EMAIL PROTECTED]