Hi everyone,

I'm new to the list, but was driven to subscribe by a problem that's been driving me mad for days.

I have three tables: publications, authors, and pub_author. I designed it this way b/c pubs can have multiple authors, and I wanted a controlled list of authors. They're joined like so:

SELECT p.publication_id, p.publication_title, a.author_name, a.author_id
FROM   publications p, publication_author pa, authors a
WHERE  p.publication_id = pa.pub_id
AND    pa.auth_id = a.author_id

ORDER BY p.publication_title;

...which gives me multiple rows for publications with more than one author.  So Pub 1-Auth1, Pub1-Auth2, Pub2-Auth3, Pub3-Auth4 = 4 rows for 3 records. My output uses grouped nested cfoutputs for display, essentially like this:

<cfoutput query="research" group="publication_title" maxrows="10">
#publication_title#
   <cfoutput>
     #author_name#
   </cfoutput>
</cfoutput>

But the maxrows attribute goes by the query record count, rather than the count of unique publication_titles. So instead of seeing 10 records per page, I may get 6 or 9 or 7--the system is counting each author row and thinks it's reached 10 before it actually has.

I've tried the custom tag cf_recordcount, and that counts correctly *outside* the record listing (e.g., "Found 22 results" instead of "Found 34"), but doesn't affect the way the cfoutput maxrows attribute works.

Am I missing something totally obvious??
Thanks for any help.
-c
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to