php - select every other row in MySQL without depending on any ID? -



php - select every other row in MySQL without depending on any ID? -

considering next table doesn't have primary key, can select every other row?

col1 col2 2 1 b 3 c 12 g

first select must find: 2, 3

second select must find: 1, 12

is possible?

in unique mysql fashion:

select * ( select * , @rn := @rn + 1 rn table1 bring together (select @rn := 0) ) s rn mod 2 = 0 -- utilize = 1 other set

example @ sql fiddle.

php mysql sql mysqli-multi-query

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -