How I can use two timeseries column in grafana 7.1.3 for date range selection, I am using Postgres

Please see below the query, I am unable to use two timeseries column in postgres sql query

Select executionid, workflowname, min(starttime), max(endtime) endtime from tablename
where executionid not in (Select distinct executionid from tablename where description=‘failed’)
group by executionid,workflowname;