If your table is named 't_example' you could use this select stament:
SELECT f1,MAX(F2) AS F2
FROM t_example
GROUP BY F1
ORDER BY 1
This produces the following result:
F1 F2
A 1
B 2
C NULL
If you want you can add a 'where' like:
SELECT f1,MAX(F2) AS F2
FROM t_example
WHERE F1='B'
GROUP BY F1