SELECT
idClient, count(*) as multiVisitCount
FROM
(
SELECT
idClient, idProperty, count(*) as visitCount
FROM
inspections i
GROUP BY
idClient, idProperty
) j
WHERE
visitCount > 1
GROUP BY
idClient
btw Is there much contract work going? Looks like I might need some past
late November... probably a bad time anyway.
Matt
> 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/