将3列合并为一列 [英] Combining 3 Columns into one

查看:95
本文介绍了将3列合并为一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一个将多个列组合在一起的查询。

我想要做的一个例子如下:


Col 1 Col 2 Col 3

15 ..... 13 ..... 10

2 ..... 9 ...... 12.5

6 ..... 5 ...... 22


查询新colunm

15

2

6

13

9

5

10

12.5

22

但是列字段是文本。

i need to write a query that combines more than one column together.
one example of what i am trying to do is as follows:

Col 1 Col 2 Col 3
15..... 13..... 10
2..... 9...... 12.5
6..... 5...... 22

Query new colunm
15
2
6
13
9
5
10
12.5
22
However the column fields are text.

推荐答案

I我假设这不是一个家庭作业问题。如果是我们的规则,则不允许我们回答。


您需要使用Union查询来执行您的要求。我可以显示部分内容(因此如果是家庭作业问题,则不会给你完整答案)如下:

I''m assuming this is not a homework question. If it is our rules do not permit us to answer it.

You need to use a Union query to do what you ask. I can show part of this (thus not giving you the complete answer if it is a homework question) as follows:

展开 | 选择 | 换行 | 行号


实际上我想做的事情有点复杂,我甚至不确定它是否可能。

这就是我想做的事情


零件编号..... Col 1 ....... Col 2 ..... Col 3

1 .......... ............... 10 .......... 20 ........ 30

2 ...... .................. 11 ..........____ 31

3 .. ...................... 12 ..........__ .. ......__


我的问题是我可以这样做:


零件号.......新Col

1 .................. 10

2 ............. ..... 11

3 .................. 12

1 ....... ........... 20

1 .................. 30

2。 ................. 31


如果col 2或col 3正在尝试查询复制零件编号用过的。然后把它变成一张桌子。

这不是作业,学校甚至没有开始


谢谢
actually what i am trying to do is a bit more complicated, and im not even sure if it is possible.
here is what i am trying to do

Part Number.....Col 1.......Col 2.....Col 3
1........................10..........20........30
2........................11..........__........31
3........................12..........__........__

my question is can i do this:

part number.......New Col
1..................10
2..................11
3..................12
1..................20
1..................30
2..................31

im trying to have a query that replicates the part number if col 2, or col 3 are being used. and then make that a table.
this is not homework, school hasnt even started

Thanks


嗨。它有助于预先了解您的需求,因为解决方案并不完全相同。

Hi. It helps to know what you want up front, as the solution is not quite the same.

展开 | 选择 < span class =codeDivider> | Wrap | 行号


这篇关于将3列合并为一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆