Access sql查询循环引用错误

发布于 2024-08-29 17:16:35 字数 287 浏览 3 评论 0原文

我正在为 Access 数据库创建 sql select 查询,并收到循环引用错误,因为我的别名与表达式中的列名相同。这是我的查询的片段:

switch([CULET]='N','NONE', [CULET]='S', 'SMALL',[CULET]='VS','VERY SMALL', [CULET]='SL','  ',[CULET]='MD','  ') AS [Culet] 

这个特定的别名是输出要求的一部分。有没有办法在不更改别名的情况下解决这个问题?

TIA

I'm creating a sql select query for an access database, and receiving a circular reference error, because my alias name is the same as a column name in my expression. Here is the fragment of my query:

switch([CULET]='N','NONE', [CULET]='S', 'SMALL',[CULET]='VS','VERY SMALL', [CULET]='SL','  ',[CULET]='MD','  ') AS [Culet] 

This specific alias name is part of the requirements for the output. Is there any way to get around this without changing the alias name?

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

玩物 2024-09-05 17:16:35

表名称/别名添加到字段中。像这样的东西

Switch([Table1.CULET]='N','NONE',[Table1.CULET]='S','SMALL',[Table1.CULET]='VS','VERY SMALL',[Table1.CULET]='SL','  ',[Table1.CULET]='MD','  ') AS Culet

Add the table name/alias to the field. Something like

Switch([Table1.CULET]='N','NONE',[Table1.CULET]='S','SMALL',[Table1.CULET]='VS','VERY SMALL',[Table1.CULET]='SL','  ',[Table1.CULET]='MD','  ') AS Culet
独留℉清风醉 2024-09-05 17:16:35

有时,当循环引用实际上位于用作您正在处理的查询的基础的查询之一内时,可能会发生此错误(即使基础查询本身实际上不会引发任何错误!)在这种情况下,您应遵循Microsoft 知识库(知识库)文章 97526 中的建议,基础查询。

Sometimes, this error can occur when the circular reference is actually within one of the queries used as the basis of the query you are working on (even when the basis query actually doesn't raise any errors, itself!) In this case, you should follow the recommendations in Microsoft's KB (knowledge-base) article 97526, for the basis query.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文