I think Chris has probably hit on the problem with the mutliple categories. If you are selecting the category as one of the fields, then your query will return a separate record for each category. The records aren't affected by DISTINCT when the records aren't actually the same.

Blair

On 5/8/06, Seona Bellamy <[EMAIL PROTECTED]> wrote:
On 08/05/06, Chris Velevitch < [EMAIL PROTECTED]> wrote:

I think might have to use the distinct in a subquery

select ... where d.id = (SELECT DISTINCT( d.ID) from r_document AS d,
                                  r_docByType AS dt WHERE dt.docTypeID
= 1 AND
                                  dt.documentID = d.ID ... LIMIT 3)

and then use the that to get the records you need.

Are we able to do this? I seem to remember running into this recently and finding that our version of mySQL didn't support subqueries? Or have we upgraded?

Cheers,

Seona.







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to