It still don't make much sense, you say you've got these fields, but you don't want the information is these columns, but you need to select these colums?
Now what are you actually attempting to say?
That you have a table named 2017 that stores the information of each pupil in a separate row:
row1: pupil1
row2: pupil2
Or is each puple actually stored on the same row in a separate column?
colum1 column2 column3
row1: pupil1 pupil2 pupil3
?
If that's the case then I would say that's your first problem, and would think that you may want to reconsider how you designed your database.
And your saying you need to display columns inside a table? What do you mean? Inside a table on a web page? Or are you just asking how to display the colums from a table in a database?
I'm just guessing because I don't understand your explanation, but if you can answer my questions and/or explain a little more clearyly then maybe I can help you. :D