Paw Prints

Thursday, November 20, 2014

Count (DISTINCT) saved my brain.

I'm building a "dashboard" which counts up objects in a time period. It happens that the objects have parts (that is to say 'part A', 'part B', etc.) that reside in a separate table. When I would join the parts table into the object table, all of the sudden my count for each object would increase, totally blowing my mind! Using Count(DISTINCT object) brought me back to my original counts and my brain was saved from the pounding of frustration.

Here’s to you, Count(DISTINCT), a real database hero!

Woof woof!
Jason

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.