2016-02-25 132 views
0

我正在写一个SQL查询,这是我迄今为止。但是,尽管它们存在于数据库中,但不会显示结果。我已经看过,我只是没有看到它可能是错的。偶然的情况下,有人看到这里可能会出现什么错误吗?SQL查询不显示结果

SELECT customer_Name AS "Customer Name", 
     customer_Telephone AS "Customer Tel.", 
     rent_date AS "Date Out", 
     date_due AS "Date Due", 
     (bike_Number +' ' + bike_Model) AS "Bike No. and Model" 
FROM rental_record 
    JOIN Customer using (customer_ID) 
    JOIN bike_Record using (bike_Number) 
WHERE sysdate > date_Due 
    AND time_Actual = NULL 
ORDER BY date_due DESC; 
+1

可以使用'='在SQL比不上'NULL'。您需要'time_actual IS NULL'来代替。 '+'不用于连接SQL中的字符串,您需要使用'||'作为它。你正在使用哪个DBMS? –

+0

看起来像Oracle –

+0

@AdrianLynch:then'bike_number +'''会引发错误。 –

回答

3

更改此:

AND time_Actual = NULL 

要这样:

AND time_Actual IS NULL