Working with a database structure I didn't create and hoping for some help on a simple MySQL query. I have a voting table `votes` with these fields:

`vote_id` = unique vote identifier

`item_id` = id of the entry voted on

`voter_id` = the id of the member who entered the vote

`vote_date` = the date of the vote

`vote` = the type of vote (1 or 2)

Each user can vote multiple times on a site entry specified by `item_id`. They can place a vote of 1 which is a "like" vote, or a vote of 2 which is an "unlike" vote. Each time they vote, a new record is created. I would like to be able to find the most recent `vote` value for each user on a particular `item_id` and then be able to actually SUM or COUNT the vote column IF the vote value is a "like" (value of 1)

For example

```
vote_id   item_id   voter_id   vote_date     vote
60        9         27         1273770151    1
153       9         45         1274896188    1
163       9         3          1274918584    1
164       9         3          1275021495    2
1051      9         181        1290839090    1

```

I want to get the newest `vote` values for each user, and then do a count of how many votes of 1 there are. In this case, the # would be 3

```
27  = 1
45  = 1
3   = 2
181 = 1
      3

```

Ideally once I have a "score" for each `item_id`, the query would be able to SUM the score of each one into a total # of ALL current "likes" on the site.

Thanks for any help with this. I did my best to find an answer to this by searching but nothing was exactly right.

Much appreciated.