由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - SQL combine two columns from two different tables no shared (转载)
相关主题
help about SQL for ACCESS请教一个mysql 排序问题。
请教SQL server的一个programming的问题,谢谢Help! A cluster method in SQL
SQL combine two tables into one table and add a new columnOracle,table有上千个column
compare two large tables SQL (转载)Access 里面两个 column不一样的table 能combine 到一起吗?
SQL find distinct values in large tableSQL问题请教: add one more column
Table Merge (SQL Server)SQL Server table variable 的一个问题请教。
初级问题In MySQL, 如何在procedure里create trigger?谢谢了?
Help on Sql server huge table performance很弱的Oracle问题
相关话题的讨论汇总
话题: two话题: city话题: columns话题: sql话题: tables
进入Database版参与讨论
1 (共1页)
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
1 (共1页)
进入Database版参与讨论
相关主题
很弱的Oracle问题SQL find distinct values in large table
SQL Server Trigger on System Base Table or Catalog ViewTable Merge (SQL Server)
一个single table 的 SQL QUERY初级问题
SQL multiply all values of a column in table (转载)Help on Sql server huge table performance
help about SQL for ACCESS请教一个mysql 排序问题。
请教SQL server的一个programming的问题,谢谢Help! A cluster method in SQL
SQL combine two tables into one table and add a new columnOracle,table有上千个column
compare two large tables SQL (转载)Access 里面两个 column不一样的table 能combine 到一起吗?
相关话题的讨论汇总
话题: two话题: city话题: columns话题: sql话题: tables