Q&A for people looking to bypass life's everyday problems with simple tricks
declare @UserId int = ##UserId## select COUNT(*) from votes WHERE votetypeid = 6 AND UserId = @UserId