On Sunday 22 June 2003 11:15, Rudi Starcevic wrote:
> Hi,
>
> I have a table with duplicates and trouble with my SQL.
(...)
> select a1.id
> from aap a1
> where id < ( SELECT max(id) FROM aap AS a2 )
> AND EXISTS
> (
> SELECT *
> FROM aap AS a2
> WHERE a1.keyword = a2.keyword
> )
How about (untested):
SELECT a1.id
FROM aap a1
WHERE id = (SELECT MAX(id) FROM aap a2
WHERE a2.keyword = a1.keyword)
Ian Barwick
barwick(at)gmx(dot)net