sql group by each row select : sql table name= phones
rows= id, mobileno, status, userid, createdon

each user can have multiple numbers,  i want to find oldest active phonenumber for each users.
status=1 is active.

for example:

user1= id=1, mobileno=123, status=1,userid=1,createdon=2019/12/20

user1= id=1, mobileno=1234, status=1,userid=1,createdon=2019/12/19

user1= id=1, mobileno=12348, status=0,userid=1,createdon=2019/12/17

user2= id=2, mobileno=12345, status=1,userid=2,createdon=2019/12/15

user2= id=2, mobileno=123456, status=1,userid=2,createdon=2019/12/10


result must be 

user1= id=1, mobileno=1234

user2= id=2, mobileno=123456
(id unqiue and mobileno= oldest active one)

thanks.


