How to select distinct record?
This query with a DISTINCT:

SELECT DISTINCT Name, MyID
FROM data;


Returns distinct Name and MyID:

Name     |  MyID
Alan     |  2
John     |  3


This query with a GROUP BY:

SELECT MIN(ID) AS ID, Name, MyID
FROM data
GROUP BY Name, MyID;


Returns Name and MyId with the smallest ID like your sample:

ID   |  Name     |  MyID
1    |  Alan     |  2
3    |  John     |  3


Both query are in this SQL Fiddle and will work with most RDBMS. (Sample uses SQL Server)