MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Gelu Gogancea Date:August 28 2002 3:53pm
Subject:Re: SQL - Update problem
View as plain text  
Hi,

Egor has right and i didn't read very carefully you e-mail.Sorry....

You can try this :
SET @a:=0;
SET @b:=0;
SELECT @a:=COUNT(*),@b:=sekce.id FROM odkaz,sekce WHERE odkaz.sekce_id =
sekce.id;
UPDATE sekce SET pocet = @a  WHERE  id= @b;

Now...i think it's corect...

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : gg@stripped
                                          gelugogancea@stripped
----- Original Message -----
From: "Jakub Mach" <asp@stripped>
To: "Mysql" <mysql@stripped>
Sent: Wednesday, August 28, 2002 5:15 PM
Subject: SQL - Update problem


> Hi,
>
> how can I do sql command like this:
>
> update sekce set pocet = count(*) from odkaz where odkaz.sekce_id =
sekce.id
>
> Thanks for answer
>
> j.
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <mysql-thread118214@stripped>
> To unsubscribe, e-mail <mysql-unsubscribe-ggelu=arctic.ro@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>

Thread
SQL - Update problemJakub Mach28 Aug
  • RE: SQL - Update problemMary Stickney28 Aug
    • [select into] RE: SQL - Update problemWouter van Vliet28 Aug
    • Re: MS Access and mySQLNicholas Stuart28 Aug
  • Re: SQL - Update problemEgor Egorov28 Aug
  • Re: SQL - Update problemGelu Gogancea28 Aug
  • Re: SQL - Update problemGelu Gogancea28 Aug