gpt4 book ai didi

sql - 如何在Access SQL的列别名中使用表名?

转载 作者:行者123 更新时间:2023-12-04 14:19:36 27 4
gpt4 key购买 nike

在MS Access中,我的表是:Exam {id,name},而我的查询是

select Exam.id as 'Exam.id',Exam.name as 'Exam.name' from Exam

现在,当我执行此查询时,会发生此错误:

"Exam.id" is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.



我想使用完整的表+列作为别名,将Exam.name用作“Exam.name”,但是我怎样才能让Access接受它呢?

最佳答案

如错误所示,MS Access的别名中不允许标点符号。考虑修改查询以消除标点符号。

select e.id as 'ExamId', 
e.name as 'ExamName'
from Exam e

关于sql - 如何在Access SQL的列别名中使用表名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3601140/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com