本文介绍了如何在Access SQL的列别名中使用表名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

In MS Access, my table is:Exam{id,name}, and my query is

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

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

Now when I executed this query this error ocurred:

我想使用完整的表+列作为别名,将Exam.name用作"Exam.name",但是如何获得Access接受呢?

I want to use the full table + column as the alias, Exam.name as 'Exam.name', but how can I get Access to accept it?

推荐答案

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

As the error indicates, punctuation is not allowed in an alias in MS Access. Consider revising your query to eliminate punctuation.

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

这篇关于如何在Access SQL的列别名中使用表名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 11:43