mysql - Search a combination of 3 values -
mysql - Search a combination of 3 values -
i want search in mysql database combination of 3 successives values example, here table:
| id | value | | 1 | value0 | | 2 | value1 | | 3 | value2 | | 4 | value3 | | 5 | value4 | | 6 | value0 | | 7 | value1 | | 8 | value2 |
i want search, how many times there is, in order row containing "value0", , next row contains "value1" ans next row contains "value2". in above data, result 2 have twice value0, value1, value2 in 3 successives rows.
is possible sql ?
thanks lot.
try friend
select count( value ) test value = 'value0' , id +1 in ( select id test value = 'value1' ) , id +2 in ( select id test value = 'value2' )
mysql sql
Comments
Post a Comment