Microsoft
Software
Hardware
Network
Question : SQL Syntax for View with two fields same name
Dear Experts
I am trying to create a view of two tables using the syntax below:
'create view time_spent as
select * from support_calls LEFT OUTER JOIN dbo.support_call_actions ON support_calls.id = support_call_actions.id
where support_calls.id = support_call_actions.id'
However I am getting the following error message:
Msg 4506, Level 16, State 1, Procedure time_spent, Line 3
Column names in each view or function must be unique. Column name 'id' in view or function 'time_spent' is specified more than once.
If I run only the select statement in QA the results are returned but I cannot create the view?
Can anyone help with this?
Thanks
Answer : SQL Syntax for View with two fields same name
select support_calls.id as id1,support_call_actions.i
d as id2 from support_calls LEFT OUTER JOIN dbo.support_call_actions ON support_calls.id = support_call_actions.id
also you don't need where clause
Random Solutions
Help setting up simple Isolated Wifi VLAN
installing a UCC certificate with local domains for Exchange 2010 - how does the certificate authority approve them?
jQuery: Add div at beginning of other div
datagrid question
Delphi 6 not recompiling .pas files
When I encrypt/encode a string using codeigniter encryption class, it is different everytime, why?
How Can I Turn Off the Record Selector Bar on an Inserted SubForm?
Server Loses Internet Access After Reboot
Linq and new features design in VS 2008
SCCM Scan agent fails with Scan Failed for ToolUniqueID with error 0x80070005