l******9 发帖数: 579 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: SQL combine two columns from two different tables no shared columns
发信站: BBS 未名空间站 (Fri Jun 27 12:46:58 2014, 美东)
On SQL server 2008, I need to get a new table by selecting two columns from
two different tables.
address (from another_table) id_num (from a cte created by me)
city_1 65
city_1 36
city_2 65
city_2 36
city_3 65
city_3 36
Suppose that id_num has only 65 and 36 two values. The cte has no column of
"address". the another_table has no column of id_num.
the two tables do not have shared columns.
Any help would be appreciated. | a**d 发帖数: 4285 | 2 select t1.address, t2.id_num
from another_table t1
cross join cte t2 |
|