I want to select 15 columns from a table of 20 columns. Is there a way to exclude those 5 columns instead of specifying other 15 columns.
4 Answers
I don't think it's possible, and it is not such a good idea. What if your columns change later? Than your results will not correspond to your objects. If your question comes from plain laziness than you probably should reconsider.
2 Comments
donL
This is possible: check this answer out. Though it still may not be a good idea if your columns changing creates a possibility of something breaking.
webdreamer
If the columns change later he will always have to change the query either way. Actually, for the query itself, it's 3 times as likely he won't have to change it; just have to take care of the treatment of the data afterwards, if it's not a dynamic thing.