ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Self-Inflicted SQL
Subject:   update on self joins
Date:   2006-02-10 10:32:01
From:   msprotools
when i do a select on self join its really doing wonders, however, when i do an update, is says ambiguous table name.


UPDATE NODE_DEFN
Set [Master Account] = ndf2.[Master Account],
[Account]= n1.NDF_NUMBER
FROM NODE_DEFN as n1
left outer join NODE_DEFN ndf2
on n1.NDF_PARENT_RID = ndf2.NDF_RID
WHERE n1.ndf_ABSLEVEL = 1