Q:

SQL single table with two columns

I have a single table: Checking, with two columns: ID, Memo
ID is the primary key.
I would like a query that returns both columns: ID, Memo BUT only where Memo is DISTINCT
I can do the following to get the distinct values from Memo:
SELECT DISTINCT(memo)
FROM checking

How do I return those Memo values and their values from the ID column? 
I've run in circles trying inner and outer joins but I'm failing.
Thanks for your help
Sample data:
ID        Memo
1         a
2         c
3         e
4         g
5         a
6         c

The desired return:
1,a
2,c
3,e
4,g

5 and 6 would not be included because they have duplicate memo values.
Thanks again for your help.

A:

SELECT  min(id), memo 
FROM checking 
group by memo

A:

If I understand you correctly you want the first (?) primary key value corresponding to each unique memo value found?  (I'm assuming this because you can't logically have both unique memos and Id values because there is necessarily multiple ID values for each duplicated memo value...)  If the assumption is correct this will work:
SELECT m.memo, 
    (SELECT TOP 1 x.id
     FROM checking x
     WHERE x.memo = m.memo
     ORDER BY x.id) as ID
FROM checking m
GROUP BY m.memo

