MY TABLE (the lines which starts with "AA" contains company code and name only. the next 4 lines below that 1st like contains that company details and after that 4 lines again a line with company name... and so on)
id col1 col2 col4 | col5 | col6 | col7 | col8
1 AAV987 Alcatop Pvt | | | |
2 126B Burger 10 | -- | 15 | 20 | 56
3 957A Pizza 17 | 19 | 44 | 29 | 97
4 45A5 Mushroom 59 | 22 | 15 | -- | --
5 8999 Fish 27 | 39 | -- | 20 | 20
1 AA5697 Nomendus Curies
2 126B Burger 42 | 26 | 25 | 29 | 60
3 957A Pizza 65 | 65 | 90 | 29 | 9
4 45A5 Mushroom 15 | 97 | -- | 64 | 65
5 8999 Fish 7 | 19 | 15 | -- | 20
I NEED THIS
i need a query which helps me to do like this
if search term is "AA5697" then it should get me the data as below
id col1 col2 col4 | col5 | col6 | col7 | col8
1 AA5697 Nomendus Curies
2 126B Burger 42 | 26 | 25 | 29 | 60
3 957A Pizza 65 | 65 | 90 | 29 | 9
4 45A5 Mushroom 15 | 97 | -- | 64 | 65
5 8999 Fish 7 | 19 | 15 | -- | 20
similar question 1: Mysql Select Next & Prev row not order by id
similar question 2: sql pulling a row for next or previous row of a current row
i looked at them. but it confuse me and the query in 1st link didn't wokred perfectly :(