Hi guys,

I'm trying to create a snapshot of latest articles on our website. For some strange reason, it's giving me duplicates and I can't figure out what's causing it - I thought that the use of "DISTINCT" was supposed to fix that?

I have the following query:

    SELECT        DISTINCT(d.docTitle), d.docIntro, d.docContent, d.docImage, dc.categoryID, d.ID
    FROM           r_document AS d,r_docByType AS dt,r_docByCategory AS dc
    WHERE        dt.docTypeID = 1
    AND             dt.documentID = d.ID
    AND             dc.documentID = d.ID
    ORDER BY  d.dateEntered DESC
    LIMIT           3

It is then output by the following code:

<cfoutput query="q_getFrontArticle">
    <div class="front clearfix">
      <h2>#docTitle#</h2>
      <cfif docImage neq ""><img src="" alt="#docTitle#" class="imgLeft" /></cfif>
      <cfif docIntro neq "">
          #docIntro# <p><a href="">       <cfelse>
          #FormatTeaser(docContent,400,"/infobase/index.cfm?page=viewDoc&amp;record=#id#&amp;cat=#categoryID#")#
      </cfif>
    </div>
</cfoutput>

If you have a look here, you'll se what I'm getting: http://www.renovate.com.au . Why isn't it giving me individual records? I've checked the database, and they're only in there once. I've tried changing it so that I run the DISTINCT bit on the ID, the image name, and the title. No change.

Cheers,

Seona.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to [email protected]
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