Any easy way to select only columns with values?
Moderator: General Moderators
Any easy way to select only columns with values?
I have a huge data table which stores CSV report data for users. A user can view his report, which currently selects all records tied to his userID. However, not all of the columns are even used, only around 5 or 10, depending on the CSV format which was uploaded. Is there any easy way to filter out the null columns in a select statement? The only other option is to do it through PHP, which will be more work.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Is this in a database or in a CSV text file? I am guessing a database. You can specify the columns that you want using the "SELECT col1,col2 FROM table" syntax. But you can't say to only provide data from non-Null columns. Besides, there is no data to retrieve so the Null columns should not increase the amount of data transfered much.
(#10850)