No, I am not getting any error its just that YOUR count variable is adding +1 to MY count() function:
So for example:
Code:
SELECT COUNT(votes.vote_id) as vote_count, users.firstname, users.lastname, COUNT(*) + 1 AS another_record_number
FROM users
LEFT JOIN votes on (votes.user_id = users.user_id)
WHERE users.user_id <
( SELECT user_id
FROM users
WHERE firstname = 'Sally'
AND lastname = 'Gratton' )
GROUP BY votes.user_id
I am getting the result as:
Code:
vote_count | firstname | lastname | another_record_number
-----------------------------------------------------------------------------
10 | Sally | Gratton | 11
Bookmarks