select client_id, property_id, count(*) from inspection group by client_id, property_id having count(*) > 1
query.recordcount is your answer. Cheers, Phil. ----- Original Message ----- From: "Toby Tremayne" <[EMAIL PROTECTED]> To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, September 18, 2003 1:28 PM Subject: [cfaussie] OT: sql question > Hi All, > > I have a mildly tricky one for you - the english explanation of > what I want to do is as follows: > > when a client inspects a property, a record is created. What I > need returned, is a count per client, of how many times they've > inspected properties more than once. For instance: > > the client has inspected property A twice, property B three times, > and property C twice. The count of multiple inspections should > come back equalling 3. > > this make sense to anyone? I'm positive I've seen or perhaps even > done something like this before, but I can't for the life of me > remember how to achieve it. Any help would be greatly appreciated > ;) > > cheers, > Toby > > > > > -------------------------------- > > Life is Poetry, > write it in your own words > > -------------------------------- > > Toby Tremayne > Cold Fusion Developer > Code Poet and Zen Master of the Heavy Sleep > Virtual Tours > +61 416 048 090 > ICQ: 13107913 > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MX Downunder AsiaPac DevCon - http://mxdu.com/ > --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/
