Hi,
I am running this query and expecting distinct results
ebmh=> SELECT DISTINCT articles.id FROM articles, paragraphs WHERE
paragraphs.ar
ticle_key = articles.id and paragraphs.paragraph ~* 'dementia' ORDER BY
articles
.page_no;
id
--
4
4
4
4
16
12
12
12
12
12
3
3
3
(13 rows)
however, if i remove the ORDER BY, it works
ebmh=> SELECT DISTINCT articles.id FROM articles, paragraphs WHERE
paragraphs.ar
ticle_key = articles.id and paragraphs.paragraph ~* 'dementia';
id
--
3
4
12
16
(4 rows)
this is in 6.4 and 6.5.2, am i doing something wrong?
Cheers
Tim Joyce
Chief Enthusiast
tim@hoop.co.uk
HOOP Ltd
http://www.hoop.co.uk
01202 251 816
HOOP is proud to be a member of the Paneris community (www.paneris.co.uk)