CQL中的查询日期

问题描述 投票:0回答:1

[我想通过按日期限制结果来在Cassansdra DB中运行CQL查询,当我运行不过滤的简单查询时,得到以下结果:

select * from bssapi.call_detail_records where subscription_id = '116377120' and year = 2020 and month = 3;

我得到的结果如下:

subscription_id | year | month | event_at                 | id                             | account_unit_type | b_number   | balance_after | balance_before | balance_id | basic_service_code | billable_amount | billable_unit | billing_item__code | call_case | call_destination | call_destination_type | cell_id  | created_at               | customer_id | data_amount | dc_event    | direction_type | duration | event_type | invoice_sequence_id | lac  | mcc | msisdn     | network_code | product_code | reference_price | roaming_indicator | service_category | service_type | subscription_type | technical_call_case | total_with_vat | transaction_amount
-----------------+------+-------+--------------------------+--------------------------------+-------------------+------------+---------------+----------------+------------+--------------------+-----------------+---------------+--------------------+-----------+------------------+-----------------------+----------+--------------------------+-------------+-------------+-------------+----------------+----------+------------+---------------------+------+-----+------------+--------------+--------------+-----------------+-------------------+------------------+--------------+-------------------+---------------------+----------------+--------------------
       XXXXXXXX | 2020 |     3 | 2020-03-01 07:45:51+0000 | POSTPAIDÿ3489472270ÿ2020-03-01 |                 0 | XXXXXXXX |           0.0 |            0.0 |       null |                 11 |              60 |       seconds |           BNATCALL |         0 |              066 |              national |     2730 | 2020-03-01 07:58:48+0000 |   XXXXXXXXXX|           0 | CALLNAT600R |            MOC |       16 |       CALL |             3626608 | 0A2A | 603 | XXXXXXXXX |        DZAOT |         null |             5.0 |                 0 |             null |            1 |          XXXXXXX|                1011 |            0.0 |                0.0

[我想要的是仅获得一天的结果,例如仅获得今天的结果“ 2020-03-19 07:45:51 + 0000”,我尝试了几次查询,但我无法获得正确的结果结果,例如我尝试了以下方法:

select * from bssapi.call_detail_records where subscription_id = '116377120' and created_at > '2020-03-19 00:00:00' allow filtering;

返回的错误是:

InvalidRequest: code=2200 [Invalid query] message="Partition key part year must be restricted since preceding part is"
cql
1个回答
0
投票
event_at提出要求:

select * from bssapi.call_detail_records where subscription_id = '116377120' and year = 2020 and month = 3 and event_at = '2020-03-19 07:45:51+0000';

© www.soinside.com 2019 - 2024. All rights reserved.