php - How to Select 1 Row From Each 10 Rows in MySQL -


i recording real time change of given signal database table.

then draw line graph visualize change of signal level.

i want (10n+1)th rows in table make rough graph. 10 arbitrary. user may change value.

does know how make just using mysql query

if no, go php after selecting data.

here table structure is:

|id        |signal1   |signal2   | signal 3   | +----------+----------+----------+------------+ |1         |0.41452   | 1.32135  | 0.31231    | ... 

if have auto_incrememt id column, can select rows divisible n

select * tablename1 mod(id,10)=0;  // id divided 10 remainder equal 0 (exact) 

or without sequential column id's

select * (      select          @row := @row +1 rownum, colname1      (          select @row :=0) r, tablename1     ) ranked  rownum % 10 = 1  

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -