Can anyone tell me what is wrong with this?
UPDATE sales t2
INNER JOIN
(SELECT (t1.commission rate * t2.amount) as commission
FROM salesreps t1, sales t2)
t1 ON t1.rep = t2.rep
SET t2.commission = commission;
I get this error.
ERROR 1054 (42S22): Unknown column 't1.rep' in 'on clause'
UPDATE sales t2
INNER JOIN
(SELECT (t1.commission rate * t2.amount) as commission
FROM salesreps t1, sales t2)
t1 ON t1.rep = t2.rep
SET t2.commission = commission;
I get this error.
ERROR 1054 (42S22): Unknown column 't1.rep' in 'on clause'