如何將以下SQL查詢轉換爲CQL查詢?Cassandra SELECT BETWEEN兩個日期
SELECT * FROM csv_report WHERE sensor_id=170268 AND create_day BETWEEN 20150401 AND 20150403;
還我試圖BETWEEN查詢不同:
SELECT * FROM csv_report WHERE sensor_id=170268 AND create_day >= 20150401 AND create_day <= 20150403;
但此查詢引發的錯誤:
code=2200 [Invalid query] message="Only EQ and IN relation are supported on the partition key (unless you use the token() function)"
那麼對於SQL Server,通常日期用單引號。所以像create_day BETWEEN'20150401'和'20150403'。我不認爲你可以在一天中輸入00。 – Stephan
謝謝@Stephan,但我在可用的cassandra db上工作,並且我必須從這種類型的數據庫中獲取數據。 – Mohsen