在算法中,用户通过查询,例如:
SELECT o_orderdate, o_orderpriority FROM h_orders WHERE rownum <= 5
查询返回以下内容:
1996-01-02 5-LOW
1996-12-01 1-URGENT
1993-10-14 5-LOW
1995-10-11 5-LOW
1994-07-30 5-LOW
该算法需要选择属性的计数(o_orderdate, o_orderpriority
在上面的示例中),因此它将查询重写为:
SELECT o_orderdate, count(o_orderdate) FROM
(SELECT o_orderdate, o_orderpriority FROM h_orders WHERE rownum <= 5)
GROUP BY o_orderdate
此查询返回以下内容:
1992-01-01 5
然而,预期的结果是:
1996-12-01 1
1995-10-11 1
1994-07-30 1
1996-01-02 1
1993-10-14 1
知道如何重写解析阶段或用户如何通过语法不同的查询来接收上述结果吗?