小問題不正確的語法與我在這裏查詢:SQL - 附近關鍵字
CREATE VIEW rental_view
AS
SELECT
m.movie_id, movie_name, co.copy_id,
f.format_id, format_name, cu.customer_id,
(first_name + ' ' + surname) AS customer_name,
rental_id, rental_date, return_date,
ISNULL(return_date, CAST(DATEDIFF(dd, rental_date, GETDATE()) AS rental_duration
FROM
movie AS m
INNER JOIN copy AS co ON m.movie_id = co.movie_id
INNER JOIN format AS f ON co.format_id = f.format_id
INNER JOIN rental ON co.copy_id = rental.copy_id
INNER JOIN customer AS cu ON rental.customer_id = cu.customer_id
結果錯誤:
Msg 156, Level 15, State 1,
Procedure rental_view, Line 3 Incorrect syntax near the keyword 'FROM'.
我在這一個漫長的嘗試並不能解決它。
欣賞幫助。
應該在哪裏括號是什麼? – Owen
@Owen最後**之後還有兩個**)** –
@Owen:在'GETDATE())'之後'我需要兩個括號;) – Marco