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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -