SELECT 
 * 

FROM 
 `visit`
 
WHERE  
  IF( :country<>'', IF( :country='all', true, `country` = :country ), true )
 AND 
  NOT( ( `ip` IS NULL ) OR ( `ip` = '' ) ) 
	
ORDER BY
 `created` DESC
 
LIMIT 
 :limit 
 
OFFSET 
 :offset	