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'
Sorry, I should have been more specific on what I am trying to do. Here's my table. AvgSaleslastweek is the value I am trying to write back into the table.
Date Salesperson Amount AvgSaleslastweek
1/1/05 Bob 50 50
1/2/05 Jon 100...
What is the best way to replicate a column from one table to another table dynamically so that as values in table one change they are reflected in table 2?
I ask because I am trying to calculate values for a field based on other fields in the same table. When I try to do so I get this error...
Sorry, I should have been more specific on what I am trying to do. Here's my table. AvgSaleslastweek is the value I am trying to write back into the table.
Date Salesperson Amount AvgSaleslastweek
1/1/05 Bob 50 50
1/2/05 Jon 100...
I have some transactional type data in a table. I am trying to update columns in that table with calculated values based on the data in the same table, but evidently I am unable to write a lookup value to the same table referenced in the subquery I am using to generate the value to be written...
Dumb question. I have been browsing through a lot of SQL tutorials but am not sure how this is done, and hoped someone could point me in the right direction.
Table is:
person date amount
Bob 2005-05-10 50
Tom 2005-05-10 100
Bob 2005-05-09 75
Tom...
I am looking for graphical query tool to work with MySQL 4.1. I installed a copy of their query browser, but get the following error.
MySQL Error Nr. 1251
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Anyone have any insight into this...
I am trying to setup a process whereby a text file is imported into a table daily. It would simplify my life greatly to be able to write either the filename, or the file's last modified date, into a seperate column in the table and associated with each row of data imported for the particular...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.