SQL连接之间的区别

时间:2015-01-15 23:11:41

标签: sql sql-server excel crystal-reports

当我改变这个时:

FROM "Server"."dbo"."SalesTable" "SalesTable"

INNER JOIN "Server"."dbo"."ItemTable" "ItemTable" 
ON "ItemTable"."ItemKey"="SalesTable"."ItemKey"

INNER JOIN "Server"."dbo"."ItemClassTable" "ItemClassTable"
ON "ItemTable"."ItemClassKey" = "ItemClassTable"."ItemClassKey"

INNER JOIN "Server"."dbo"."ItemDescriptionTable" "ItemDescriptionTable" 
ON "ItemTable"."ItemKey"="ItemDescriptionTable"."ItemKey"

INNER JOIN "Server"."dbo"."timSalesProdLine" "timSalesProdLine" 
ON "ItemTable"."SalesLineKey"="timSalesProdLine"."SalesLineKey"

INNER JOIN "Server"."dbo"."InventoryTable" "InventoryTable"  
ON "ItemTable"."ItemKey" = "InventoryTable"."ItemKey"

INNER JOIN "Server"."dbo"."AccountTable" "AccountTable" 
ON "InventoryTable"."SalesAcctKey"="AccountTable"."GLAcctKey"

INNER JOIN "Server"."dbo"."CustomerTable" "CustomerTable"
ON "CustomerTable"."CustKey" = "SalesTable"."CustKey"

对此:

FROM "Server"."dbo"."SalesTable" "SalesTable"

INNER JOIN "Server"."dbo"."itemTable" "itemTable" 
ON "itemTable"."ItemKey"="SalesTable"."ItemKey"

INNER JOIN "Server"."dbo"."itemClassTable" "itemClassTable"
ON "itemTable"."ItemClassKey" = "itemClassTable"."ItemClassKey"

INNER JOIN "Server"."dbo"."ItemDescriptionTable" "ItemDescriptionTable" 
ON "itemTable"."ItemKey"="ItemDescriptionTable"."ItemKey"

INNER JOIN "Server"."dbo"."timSalesProdLine" "timSalesProdLine" 
ON "itemTable"."SalesLineKey"="timSalesProdLine"."SalesLineKey"

INNER JOIN "Server"."dbo"."inventoryTable" "inventoryTable"
ON "SalesTable"."WarehouseKey" = "inventoryTable"."WarehouseKey"

INNER JOIN "Server"."dbo"."AccountTable" "AccountTable" 
ON "inventoryTable"."SalesAcctKey"="AccountTable"."GLAcctKey"

INNER JOIN "Server"."dbo"."CustomerTable" "CustomerTable"
ON "CustomerTable"."CustKey" = "SalesTable"."CustKey"

我收到错误消息。

我正在通过Excel使用ODBC连接,错误消息是:“[DBNETLIB] [ConnectionRead(recv())。]常规网络错误。请检查您的网络文档。”

当我尝试在Crystal Reports中运行命令时,错误消息是相同的,除了它结束于:“[数据库出口代码:11]”。

只有更改是join 5,我尝试将表与“WarehouseKey”链接起来。

我可以采取哪些不同的方式?

我省略了其余的查询,因为它在两种情况下都是相同的。当然,如果需要,我可以通过编辑添加。

0 个答案:

没有答案