I have a SQL query:
select max(date) from index_constituents where (opening_closing ='O' and index_code ='buk350n' and issuer = 'cboe')
I believe this returns the latest date
where there is data in my index_constituents
table.
I am trying to find the latest date where no rows are returned.
My table looks like:
id date issuer index_code opening_closing
1393 2016-11-25 cboe buk350n O
1394 2016-11-25 cboe buk350n O
1395 2016-11-25 cboe buk350n O
1402 2016-11-25 cboe buk350n O
The issue I have is that if my query returns a day with no data, there won’t be a date either to pull max(date)
from.
Any help would be great!