I want to select distinct values from only one column (the BoekingPlaatsId column) with this query:
SELECT MAX(BoekingPlaatsId), BewonerId, Naam, VoorNaam
F
I ran into a similar problem and for me the solution was using the GROUP BY clause. So basically, I grouped all the blogs with same title as one group.
Syntax:
SELECT post_title, post_link
FROM blogs
WHERE [ conditions ]
GROUP BY post_title
ORDER BY post_title;
Maybe you are grouping multiple columns
Sounds like you want something like
select distinct(BewonerId), Naam, Voornaam from table_name
DISTINCT
should work if you just want the user names:
SELECT DISTINCT BewonerId, Naam, Voornaam
FROM TBL
but if you need the minimum ID values, group by the names...
SELECT MIN(BoekingPlaatsId), MIN(BewonerId), Naam, Voornaam
FROM TBL
GROUP BY Naam, Voornaam