I have a table named as* EVENTLOG* which has 3 columns:

    *(CASEID VARCHAR(200), DATEPLUSTIME TIMESTAMP, SUBSTATUS VARCHAR(200))*

*DATEPLUSTIME is in format of YYYY-MM-DD hh:mm:ss.* Below is the query that
will work on Apache phoenix as well as for MySQL.

    SELECT DISTINCT E1.SUBSTATUS
      FROM EVENTLOG AS E1
        WHERE E1.DATEPLUSTIME IN
             (SELECT MIN(E2.DATEPLUSTIME)
                         FROM EVENTLOG AS E2
                              GROUP BY E2.CASEID);

Table contains 466738 records. When i perform the above query in MySQL , i
get 35 rows of it but on Apache Phoenix i get 32 rows so it is missing 3
rows why is there difference in their result.
Table looks like the following(Records Striped).

     +----+---+---+---+--+----------+----+-----------+
     | CASEID |      DATEPLUSTIME  | SUBSTATUS |
     +----+---+---+---+--------+-----+---+-----------+
     |  1     | 2010-04-10 18:20:38      | Assignment|
     |  1     | 2010-04-10 20:12:56      | Update    |
     |  1     | 2010-11-23 23:12:34      | Assigned  |
     |  1     | 2010-11-25 23:45:34      | Assigned  |
     |  2     | 2010-12-30 12:32:23      | Reassigned|
     |  2     | 2014-12-30 12:34:21      | Operator  |
     |  2     | 2014-12-25 20:32:45      | Operator  |
     |  3     | 2014-12-26 08:45:54      | Progress  |
     |  3     | 2014-12-30 08:49:32      | Call      |
     +----+---+---+---+---+----+------+--+-----------+
*[Expected Output]*

    Assignment
    Reassigned
    Progress

MySQL does the task correctly butr Phoenix return incomplete result.
Please help me.


Thanks , Kunal

Reply via email to