In this data - there are multiple DATA_ID values associated with time-series data. I am trying to exclude all data from any DATA_ID values that return a NULL value for USE for any timestamp value.
In other words, I only want to return DATA_ID values (and their data) if they have complete (not any NULL) values for all timestamp values.
Sample query given below:
SELECT
My.Table.DATA_ID,
MY.Table.timestamp,
My.Table.USE
FROM
My.TABLE
WHERE timestamp BETWEEN '2012-06-01 00:00:00' AND '2012-06-02 23:59:59'
-- Something here that says exclude all data from DATA_ID(s)
-- with any missing USE data, i.e. USE=NULL
ORDER BY DATA_ID, timestamp
DATA_IDis a number of some kind,timestampis a timestamp value, andUSEis a ... what? Is that right? Or isDATA_IDactually an array or something? Also, your column names are very very poorly chosen; one is a SQL keywordUSE, one is a SQL data type nametimestamp. Please show the real table.data_idvalues if they have non-null values for all timestamps. Then in the example you say you want to exclude all data from data_ids with missingUSEvalues. These appear to be different things.