<p>I have a table of time-series data of which I need to find all columns that contain at least one non-null value within a given time period. So far I am using the following query:</p>

<pre><code>select max(field1),max(field2),max(field3),... 
   from series where t_stamp between x and y
</code></pre>

<p>Afterwards I check each field of the result if it contains a non-null value. </p>

<p>The table has around 70 columns and a time period can contain >100k entries.</p>

<p>I wonder if there if there is a faster way to do this (using only standard sql). </p>

<p>EDIT:
Unfortunately, refactoring the table design is not an option for me.</p>

Edit: I think I misread the question... this will give you all the
rows
with a non-null value.  I'll leave it here in case it helps someone but it's not the answer to your question.  Thanks @Pax
I think you want to use
```
COALESCE
```
:
```
SELECT ... WHERE COALESCE(fild1, field2, field3) IS NOT NULL
```