Witajcie,
Pisze proszte zapytanie łączące nie dane z kilku tabelek. Pojawił się problme z wyświetlniem danych z kolum o identycznej nazwie. Jak to obejśc:
Oto kod:
select [Entry No.],
[Description],**foo**
[Start Time],
[End Time],
[Name],
[Machine No. Code],
[Machine Cost Center Code],
[Machine Functional Part Code],
[Total Downtime],
[Stop Reason Description],
[Description]**foo**
from [Stops Register]
join dbo.[Stop Reasons]
on [Stop Reasons].Code=[Stops Register].[Stop Reason Code]
join dbo.Employee
on [Employee].Code=[Stops Register].[Employee No. Code]
join dbo.Shifts
on [Stops Register].[Shift Code]=[Shifts].Code
Jak widać Kolumna Discription pojawia się dwa razy, jednak są to dane z równych tabel jak widać w join. Jendka wywala mi błąd tej kolumny :
Msg 209, Level 16, State 1, Line 2
Ambiguous column name 'Description'.
Msg 209, Level 16, State 1, Line 12
Ambiguous column name 'Description'.
Jak zapisać to poprawnie?
dodanie znacznika <code> - furious programming