I have these values in a table called `galley_images`:

```
id    gallery_id    image_id
1             1            1
2             1            2
3             1            3
4             2            4 
5             2            5 
6             2            6 
7             2            7
8             3            8

```

I want to return the results like this:

```
id    gallery_id    image_id
1             1            1
4             2            4
8             3            8

```

Basically I only want the first instance of any record with a unique `gallery_id`.

I have a solution using Access DB but need a solution for MySQL, Access solution was:

```
SELECT id, First(gallery_id) AS FirstOfgallery_id,  
           First(image_id) AS FirstOfimage_id
FROM galley_images 
GROUP BY id

```

Any help?