Hi all! In a insert-trigger I have two joins on the table named inserted. Obviously this construction gives a name collition beetween the two joins (since both joins starts from the same table) Ofcourse I thougt the using bla JOIN bla ON bla bla bla AS a_different_name would work, but it does not. Is there a nice solution to this problem? Any help appriciated
You are correct that you need to use an alias. The syntax requires the "AS alias" immediately after the table name: SELECT * FROM x AS A JOIN x AS B ON A.z = B.z JOIN x AS C ON A.z = B.z If you need more help, please post your code and explain what the problem is. Do you get an error message? -- David Portas SQL Server MVP --