SQL same column name allowed

后端 未结 4 1626
Happy的楠姐
Happy的楠姐 2021-01-11 15:38

When I run this query in SQL Server

SELECT custid AAA, companyname AAA
FROM Sales.Customers
WHERE country = \'USA\'

It\'s running fine. But

4条回答
  •  忘掉有多难
    2021-01-11 16:22

    You are giving two same aliases name to different column that will render as duplicate column in one table.

    That's why it is giving error.

    If you will make it different alias name then error will not occur.just try it and let me know whether it will work or not.

提交回复
热议问题