sql >> Base de Datos >  >> RDS >> Mysql

seleccionar cada dos filas en MySQL sin depender de ninguna ID?

Al estilo único de MySQL:

select  *
from    (
        select  *
        ,       @rn := @rn + 1 as rn
        from    Table1
        join    (select @rn := 0) i
        ) s
where   rn mod 2 = 0 -- Use = 1 for the other set

Ejemplo en SQL Fiddle.