根据未知行向 Access 2003 中的查询添加列
我在 Access 2003 中有这样的查询:
col1 col2 col3 col4
111 123 001 12.5
111 123 002 12.5
111 123 003 12.5
111 123 004 12.5
---------------------
112 211 001 5.2
112 211 002 5.2
112 211 003 5.2
我想做的是移动列中以 col3 开头的行并取消重复项,我的意思是我希望最终像这样:
col1 col2 new_col3 new_col4 new_col5......(unknown # of columns)
111 123 001 002 003 004 005.................. 12.5
(here I don't want a sum like in the crosstab query).
我尝试了很多方法,但是我什么也没得到。拜托,我真的需要你的帮助。 先感谢您。
I have this query in Access 2003:
col1 col2 col3 col4
111 123 001 12.5
111 123 002 12.5
111 123 003 12.5
111 123 004 12.5
---------------------
112 211 001 5.2
112 211 002 5.2
112 211 003 5.2
What I'm trying to do is to move those rows starting with col3 in columns and suprime the duplicates, I mean I want to have in the end like this:
col1 col2 new_col3 new_col4 new_col5......(unknown # of columns)
111 123 001 002 003 004 005.................. 12.5
(here I don't want a sum like in the crosstab query).
I tried in so many ways, but I didn't get anything. Please, I really need your help.
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前尚不清楚您想要新列和行的交叉点是什么。使用您提供给我们的少量示例输出,我们假设您想要 col3/col4 值本身。要交叉制表多个列,您需要使用多个查询。
如果 col3 和 col4 中的值已知,那么另一种方法是:
现在,我们真的应该首先问一下为什么要这样做。为什么不返回多行并以这种方式处理信息呢?
It isn't clear what you want at the intersection of the new columns and the rows. Using what little sample output you gave us, let's assume you want the col3/col4 values themselves. To crosstab multiple columns, you need to use multiple queries.
If the values in col3 and col4 are known, then another way to do it would be:
Now with all that, we really should ask why on Earth you want to do this in the first place. Why not return multiple rows and process the information that way?