MYSQL Query. Hilfe wäre cool ...

09/10/2013 16:27 αѕ¢σявιη#1
Guten Tag, liebe epvp Community. ich scheitere grad ein wenig an einem MYSQL Query
Also, der Query sollte wie folgt aussehen.
aus der tabelle entschaedigung.player soll das feld "playtime" jedes Chars, der auf dem Account existiert zusammengerechnet werden und in die account.account tabelle (feld "entschaedigung") eingetragen werden
Die Account-ID ist in der entschaedigung.player als "account_id" angegeben
wäre cool, wenn jemand einen solchen query erstellen könnte :)

mfg Ascorbin
09/11/2013 19:31 .Shōgun#2
UPDATE account.account a INNER JOIN (SELECT account_id,sum(playtime) FROM player.player GROUP BY account_id) p ON a.id = p.account_id;

You need to have a playtime field in account table of course.
09/11/2013 19:48 Red Firestar#3
Wenn du immer noch Probleme hast kannst du mein Service benutzen.
[Only registered and activated users can see links. Click Here To Register...]
09/12/2013 17:13 αѕ¢σявιη#4
Quote:
Originally Posted by Uncorrupted View Post
UPDATE account.account a INNER JOIN (SELECT account_id,sum(playtime) FROM player.player GROUP BY account_id) p ON a.id = p.account_id;

You need to have a playtime field in account table of course.
doesn't work. but thanks for that
i've got the following error:
[SQL] UPDATE account.account a INNER JOIN (SELECT account_id,sum(playtime) FROM player.player GROUP BY account_id) p ON a.id = p.account_id;
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
09/12/2013 17:24 xSpongBoZZ#5
Quote:
Originally Posted by αѕ¢σявιη View Post
doesn't work. but thanks for that
i've got the following error:
[SQL] UPDATE account.account a INNER JOIN (SELECT account_id,sum(playtime) FROM player.player GROUP BY account_id) p ON a.id = p.account_id;
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Gib in Putty Den befehl Ein: chmod -R 777 /var/db/mysql
Und dann Reboot
09/12/2013 17:29 #SoNiice#6
Code:
UPDATE account.account INNER JOIN (SELECT sum(playtime) AS summe FROM entschaedigung.player) p ON p.account_id = account.account.id SET account.account.playtime = summe;
So sollte es gehen.

Quote:
Originally Posted by xSpongBoZZ View Post
Gib in Putty Den befehl Ein: chmod -R 777 /var/db/mysql
Und dann Reboot
"[Err] 1064 - You have an error in your SQL syntax;" - Das hat nichts mit den Rechten zutun.
09/12/2013 17:37 αѕ¢σявιη#7
Quote:
Originally Posted by Hühnchenkopf View Post
Code:
UPDATE account.account INNER JOIN (SELECT sum(playtime) AS summe FROM entschaedigung.player) p ON p.account_id = account.account.id SET account.account.playtime = summe;
So sollte es gehen.



"[Err] 1064 - You have an error in your SQL syntax;" - Das hat nichts mit den Rechten zutun.
Danke für den Query. jetzt werd ich Vegetarier um deine Spezies nicht zu Gefährden :) ne spaß.
Aber das ganze will noch nicht so ganz:
[SQL] UPDATE account.account INNER JOIN (SELECT sum(playtime) AS summe FROM entschaedigung.player) p ON p.account_id = account.account.id SET account.account.playtime = summe;
[Err] 1054 - Unknown column 'p.account_id' in 'on clause'

mfg
Asco
09/12/2013 18:19 #SoNiice#8
Code:
UPDATE account.account INNER JOIN (SELECT account_id, sum(playtime) AS summe FROM entschaedigung.player) p ON p.account_id = account.account.id SET account.account.playtime = summe;
So, nun aber.
09/12/2013 18:30 αѕ¢σявιη#9
Quote:
Originally Posted by Hühnchenkopf View Post
Code:
UPDATE account.account INNER JOIN (SELECT account_id, sum(playtime) AS summe FROM entschaedigung.player) p ON p.account_id = account.account.id SET account.account.playtime = summe;
So, nun aber.
[SQL] UPDATE account.account INNER JOIN (SELECT account_id, sum(playtime) AS summe FROM entschaedigung.player) p ON p.account_id = account.account.id SET account.account.playtime = summe;
Affected rows: 0
Time: 0.085ms



komisch ... kein row betroffen
Keine Ahnung an was das liegt
Die Felder hab ich schon gecheckt. sind vorhanden
09/13/2013 19:05 αѕ¢σявιη#10
push
09/14/2013 02:01 #SoNiice#11
Hatte es ihm nun in einem total umständlichen PHP Script gemacht, clsrqst.