2016-12-03 87 views
0

enter image description here顯示日期

我想顯示落在某個日期範圍 像

select * from table where column names <'certain date' 

我曾嘗試SELECT * FROM表中的所有日期其中列<「確定日期」 但它不起作用。 這些列的類型是日期類型

+0

可能的重複[如何在MySQL中檢查日期範圍內的任何日期落在表中的日期之間](http://stackoverflow.com/questions/35130602/how-to-check-in- mysql-if-date-in-a-range-of-dates-falls-between-dates-held-i) –

回答

0

爲什麼你不能使用BETWEEN運營商指定喜歡

where column_names between 'certain date' and 'certain other date' 
使用 >=<=操作

(OR)的日期範圍

where column_names >= 'certain date' 
and column_names <= 'certain other date' 

對於多個色譜柱,必須使用and/or條件包括所有這些色譜條件

where column_name1 between 'certain date' and 'certain other date' 
and column_name2 between 'certain date' and 'certain other date' 
+0

哪裏不接受多於一列:/ –

+0

這將會但你必須分開製作它們 – Rahul

+0

如果即使其中一列返回false,這也不會顯示任何值。 –