*Below is the query which is working in MySQL and not working in Oracle.
Here I need to get the latest Date and corresponding event from table r 
 for every ID in Table a . ID is unique.*

---

```
 SELECT a.name , a.spids , a.group , a.id , r.date,r.event  FROM a
    LEFT OUTER JOIN ( SELECT id, MAX(date) AS latest FROM r  GROUP BY id ) AS rev
        ON rev.id = a.id
    LEFT OUTER JOIN r  ON r.id = rev.id
       AND r.date = rev.latest
     group by a.id order by ID;
    --------------------------------------------- 
    *The error in Oracle is "Not a group by function"
    I read several blogs about group by function and every where they are saying to use an aggregate funciton like sum , min,max. I tried but not able to get the results*
    -----------------------
    Table a ( It has other column - group also)
    -----------------------

   ID  Name   Spids  
    1   SIML    TRDR,THYU
    2   SIML    YUIL
    3   ghhe    yhgu,hjuy,kiuj
    4   th      yuio

   ----------------------- 
    Table r  ( Needs to get the latest updated date and corresponding event details for every ID)
    ----------------------- 

   ID     Event         Date
    1      by chris      02-02-2016
    1      by Steve      02-02-2013
    1      by gen        02-02-2014
    2      by Pete       12-12-2018
    2      by ken        01-02-2014
    3      by Mike       20-08-2018
    3      by chin       20-08-2017
    4      by chn        04-06-2012
    4      by tink       06-06-2017

```

---

> 
> Output should be like this
>  ---------------------------
> 
> 
> 

```
NAMe     SPIDS           GROUP      ID      DATE                  EVENT
    SIML    TRDR,THYU        Test        1    02-02-2016             by chris
    SIML    YUIL             Test        2    12-12-2018             by Pete 
    ghhe    yhgu,hjuy,kiuj   Test2       3    20-08-2018             by Mike
    th      yuio             Test1       4    06-06-2017             by tink

```