Categories
MySQL

Things to chase after

MySQL specific?

select make_set(255,’bit0′,’bit1′,’bit2′,’bit3′,’bit4′,’bit5′,’bit6′,’bit7′);

select (1,2,3)=(1,2,3);

Categories
MySQL

SQL: selecting top N records per group

Based on a similar concept, combined with string walking, I now present a query which selects top-n records for each group, ordered by some condition. It will require no subqueries. It executes faster than its more conventional alternatives.

via SQL: selecting top N records per group | code.openark.org.