1
我正在嘗試編寫一個查詢來選擇此視圖。無法使用查詢創建表格
CREATE VIEW
CarRentalHistoryView
AS
SELECT
c.vehNo,
c.brand,
c.dateRegistered,
c.purchasePrice,
c.rentalCost,
c.condition as 'Before Condition',
r.condition as 'After Condtion',
r.dateRented,
r.dateReturned,
r.CustNo,cu.name,
cu.id,
cu.dateOfBirth
FROM
dbo.Car c
Inner JOIN
dbo.Rental AS r
ON
c.VehNo = r.VehNo
Inner JOIN
dbo.Customer as cu
on
cu.CustNo = r.CustNo;
GO
這是我試圖運行查詢,
Select
*
From
dbo.CarRentalHistoryView
Where
'Before Condition' != 'After Condition'
但查詢運行良好,即使是這種情況
Select
*
From
dbo.CarRentalHistoryView
Where
'Before Cion' != 'After Ction'
所以我的觀點是怎麼樣,我可以確保我可以得到與以前不同的車輛結果。 TKS!
切勿使用列別名單引號。 SQL Server中正確的轉義字符是方括號。我正在投票結束,因爲這是一個印刷錯誤。 – 2014-10-04 19:27:07