Found no column named time or time_sec

Hi,
I am successfully able to run query on mysql database.

SELECT
(CASE
                        WHEN p.host REGEXP 'sl' THEN 'RHEL'
END) AS OS,
                        p.host,  p.complete_dt as date
        FROM table1 p  inner join table2 t ON t.queue_id = p.queue_id
        inner join  checklist_runs cr ON cr.tt_id = t.id
        inner JOIN item_runs cir ON cr.id = cir.run_id
            inner JOIN c_items ci ON cir.c_item_id = ci.id
where p.IS_BACKLOG is null and
group by p.host, p.complete_dt;

When I try to run the same query in Grafana using a Graph I am getting an erro

Found no column named time or time_sec

My table and columns look as below

The error message is clear. There needs to be a column in your result with the name time or time_sec and it must be a UNIX timestamp in milliseconds or seconds respectively.

You have to specify your timestamp column as time in query, Read macros https://grafana.com/docs/grafana/latest/features/datasources/mysql/#macros

Ex.
Select dte as time, host as metric, os as value …
Query will need modification according to panels like for graph you should have int values as “value”