sql Update
Hi,
Unfortunately SQL Server doesn't support aliases using the standard
ANSI SQL UPDATE syntax. Instead you have to use the FROM clause, which
is a proprietary extension:
UPDATE qi
SET avgcost =
(SELECT avgcost
FROM e_icitems AS ii
WHERE qi.item = ii.item)
FROM quoteitems AS qi;
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
|