I had a table called 'FruitSaleList', that contains the following columns
sl.no, shop_id, fruitName, price, ....
I had also another table called 'FruitList' that contains the columns
shop_id, fruitName, salesManId, ....
the problem is 'FruitList' table doesn't contain a column like fruitId.
Let us assume there are following fruits are available in all shops
Apple
Banana
Cherry
Dates
Elderberry
Figs
Grapes
Jackfruit
Orange
(it is a lengthy list, around 50)
In some case I need to list the details of fruits after 'Grapes' from 'FruitSaleList'. That means I have to list the 'Jackfruit' and 'Orange' from 'FruitSaleList'.
I'm struggling to list these using a MySQL query in php.
If I create a table view(FruitDetails) like below then I will proceed as specified below
|FruitId|FruitName|
|1 |Apple |
|2 |Banana |
|3 |Cherry |
|4 |Dates |
|5 |Elderberry|
|6 |Figs |
|7 |Grapes |
|8 |Jackfruit |
|9 |Orange |
If it is possible then I will proceed by selecting the fruits after the fruitId 7. I can create virtual column or table but should avoid creating or alter table with real column or table.
If I haven't explained clearly, please let me know so that I will explain even more.
any help is appreciated. thanks in advance for your help.