Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 使用SQL Server 2000创建数据模板_Sql Server_Templates_Sql Server 2000 - Fatal编程技术网

Sql server 使用SQL Server 2000创建数据模板

Sql server 使用SQL Server 2000创建数据模板,sql-server,templates,sql-server-2000,Sql Server,Templates,Sql Server 2000,通过使用SQL Server 2000,我想使用表1和表2中的数据创建一个输出数据模板,如下所示 输出数据\u模板 Unit1 | Sale_value_1 | Sale_value_2| ------------------------------------------- chart1 | 25 |12| chart2 | 30 |0| chart3 | 56 |0| chart4 | 41

通过使用SQL Server 2000,我想使用表1和表2中的数据创建一个输出数据模板,如下所示

输出数据\u模板

Unit1   | Sale_value_1  | Sale_value_2|
-------------------------------------------    
chart1  | 25             |12|
chart2  | 30             |0|
chart3  | 56             |0|
chart4  | 41             |98|
表1

Date        |Unit1  |Sale_value_1|
------------------------------------    
2/11/2014   |chart1 |25|
2/11/2014   |chart2 |30|
2/11/2014   |chart3 |56|
2/11/2014   |chart4 |41|
Date        |Unit1  |Sale_value_2|
-----------------------------------    
2/11/2014   |chart1 |12|
2/11/2014   |chart2 |0|
2/11/2014   |chart3 |0|
2/11/2014   |chart4 |98|
表2

Date        |Unit1  |Sale_value_1|
------------------------------------    
2/11/2014   |chart1 |25|
2/11/2014   |chart2 |30|
2/11/2014   |chart3 |56|
2/11/2014   |chart4 |41|
Date        |Unit1  |Sale_value_2|
-----------------------------------    
2/11/2014   |chart1 |12|
2/11/2014   |chart2 |0|
2/11/2014   |chart3 |0|
2/11/2014   |chart4 |98|
这演示了以下查询:

SELECT t1.Unit1, t1.Sale_value_1, t2.Sale_value_2 
FROM Table1 as t1
INNER JOIN Table2 as t2 ON t1.Unit1 = t2.Unit1
作为旁注,输出数据模板的“技术术语”在当地语言中没有任何意义。我相信如果你说我想创建一个输出结果集或输出表,会更清楚。