ms sql 创建表
What's a quick way to combine the items in two table? For example:
将项目合并到两个表中的快速方法是什么? 例如:
- Table A has 3 items – Sugar, Coffee and Milk. 表A有3个项目–糖,咖啡和牛奶。
- Table B has 2 items – Cans and Sticks. 表B有2个项目–罐和棍棒。
How can you create a third table that has all the Table 1 items combined with each of the Table 2 items?
如何创建将表1的所有项目与表2的每个项目组合在一起的第三张表?
- Sugar – Cans, Sugar – Sticks, etc. 糖–罐,糖–棍等
使用MS查询 (Use MS Query)
I've done this with programming before, but this time I used Microsoft Query, to do the work for me.
我以前通过编程来做到这一点,但是这次我使用Microsoft Query来为我完成工作。
Add the two tables to the query, with no join line between them, and the results show each item in table 1 connected to each item in table 2.
将两个表添加到查询中,它们之间没有连接线,结果将表1中的每个项目连接到表2中的每个项目。
阅读详细资料 (Read the Details)
To see the details for setting this up, and refreshing the results table, please visit the Cartesian Join in Excel Using MS Query page on my Contextures website.
若要查看有关设置和刷新结果表的详细信息,请访问Contextures网站上的“ 使用MS Query在Excel中进行笛卡尔联接”页面。
It shows all the steps for creating the query, sending the results to Excel, and refreshing the table if the source data changes.
它显示了创建查询,将结果发送到Excel以及在源数据更改时刷新表的所有步骤。
翻译自: https://contexturesblog.com/archives/2012/11/27/create-table-combinations-with-ms-query/
ms sql 创建表