今天第一次构造 SQL Server 查询,惊讶地发现这个别名不起作用:
SELECT
INVOICE_INVOICE_NUMBER AS invno,
INVOICE_INVOICE_SEQ AS lineno
FROM
INVOICED
但这确实:
SELECT
INVOICE_INVOICE_NUMBER AS invoice,
INVOICE_INVOICE_SEQ AS line
FROM
INVOICED
更改别名没什么大不了的 - 但最好知道为什么这个特定别名不起作用,以及如何防止或了解任何未来要避免的关键字。