I am updating table_a with the stored variables in Table_A. But when I am trying to update with the selected query, I get errors, please help me Thank you very much
This is struct of 2 tables:.
do not create tables, table_a` present (`fk1` integer (11) default zero,` avg_100` int (11) default faucet, `avg_score` int (11) default null, Cvg_date` datetime default faucet) engine = InDebby default charge = latin1; (`Fk1` does not form an integer table) exist table_b` (11) No NULL default '0',` avg_100` integer (11) default zero, `avg_score` integer (11) default zero,` cvg_date` integer (11) Default faucet) engine = InDebbi default charset = latin1; and when I try to execute the query
update table_a is a left join (FK1 as avg_score, avg_score) (avg_100, FK1, SUM (Avg_100), Max FK1 by table_b group as cvg_date (cvg_date)) as B1) b as a.fk1 = b.fk1 set a.avg_score = b.avg_score, a. Avg_100 = b.avg_100, a.cvg_date = b.cvg_date I got an error:
[er] 1064 - an error in your SQL syntax is; On the line 4, check that the manual is used for the correct syntax near the corresponding for its server version 'a.fk1 = b.fk1 set a.avg_score = b.avg_score, a.avg_100 = b. "B" and "b1" in the table returned by selection, avg_100b, 'code'
UPDATE table_a Add a left (select fk1, SUM (avg_100) avg_100, average (avg_score) avg_score, MAX (Cvg_date) as cvg_date from table_b group Ra fk1) a.fk1 = b.fk1 set at AS B on a.avg_score = b.avg_score, a.avg_100 = b.avg_100, a.cvg_date = b.cvg_date < / Html>
No comments:
Post a Comment