> - find all propertyID's from a table that had duplicate
> photo200 field values
If you mean _different_ propertyID's sharing the same photo200 value, you would
need to count by the photo200 column instead. Then match it with the
propertyID.
One option is using a join. Another would be a subquery using where exists ...
select r.propertyID, pc.photo200, pc.TimesUsed
from rentalphotos r inner join
(
select photo200, count(*) as TimesUsed
from rentalphotos
group by photo200
having count(*) > 1
)
pc on pc.photo200 = r.photo200
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346729
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm