Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 help with query (select count)

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2005-01-04 : 18:51:23
Hi,

I have a vote system on a web application that is being rarely but occasionally abused by users via proxies and other methods. I want to create a SP that helps me determine when this is happening and where it is happening, but I'm having a little problem writing it.

Votes are stored in either one of two tables. One table stores votes from registered members, the other stores from unregistered members and stores according to IP's.

What the SP needs to do is get a count of total votes and total points from each table and compare them. If the ratios are visible out of proportion we will be able to take appropriate action from there.

tblUsers(userID, username)

the two vote tables

tbluservote (voteForID, points)
tblrandomvote (voteForID, points)




Thanks once again guys!
mike123

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-01-04 : 19:27:32
Can you clarify your business rules a bit? I can't tell if you are trying to compare the total votes of this table against the total votes of that table or if you want to compare the total vote of each table against the total points of each table or if you want to compare the total combined votes of both tables against the total combined points of both tables.

Or if I have completely missed the boat... (Always a possibility!)

HTH

=================================================================

Where it is a duty to worship the sun, it is pretty sure to be a crime to examine the laws of heat. -John Morley, statesman and writer (1838-1923)
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2005-01-04 : 22:11:54
Hi,

Thanks for the reply. I'd like to compare the total votes for each table against each other, as well as the total points for each table against each other.

Something like the column names below

randomTotalVotes, randomTotalPoints, randomAverageVote,
userTotalVotes, userTotalPoints, userAverageVote


Thanks again!
mike123
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2005-01-07 : 03:25:07
anyone on this ?

thx!
Go to Top of Page
   

- Advertisement -