I need to select rows which are between the two null values.
My Question is that how can i get the names and marks of selected class which i need. I can’t change table everytime, because total number of rows in table is about 13000.
I think it’s too much and even more i am getting this table from excel file with some changes every time(twice a day or even more). What will be your opinion?
for example:-
Name Marks
=================
class10 NULL
rahul 45
priti 65
terry 74
class9 NULL
Andrew 80
Nastya 75
Ajay 81
class8 NULL!
Your table has the wrong layout to serve your needs. There is no way to select rows “between values” in SQL, only if your table had an additional index that defines the order of the rows.
The correct table layout would be like this:
Then you could query all members of class10 like this:
Even better would be to make your own table for classes, but i doubt in your case of Excel-Import this would be desirable.
Hope this helps.
EDIT: Then import your excel table with an index so that it looks like this:
Then you can select your marks of your class 10 like:
Or your class 9 like:
With a scripting language like PHP you could automate this task in a script.