Top "Mysql-variables" questions

For use with special handling of queries for such things as ranking, grouping, and segmenting.

Get top n records for each group of grouped results

The following is the simplest possible example, though any solution should be able to scale to however many n top …

mysql sql greatest-n-per-group mysql-variables
MySQL - Define a variable within select and use it within the same select

Is there a possibility to do something like this? SELECT @z:=SUM(item), 2*@z FROM TableA; I always get NULL …

mysql variables select procedure mysql-variables
Optimizing COUNT(DISTINCT) slowness even with covering indexes

We have a table in MySql with arround 30 million records, the following is table structure CREATE TABLE `campaign_logs` ( `domain` …

mysql sql aggregate-functions query-performance mysql-variables