Found no column named time or time_sec

I am successfully able to run query on mysql database.

                        WHEN REGEXP 'sl' THEN 'RHEL'
              ,  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 =
        inner JOIN item_runs cir ON = cir.run_id
            inner JOIN c_items ci ON cir.c_item_id =
where p.IS_BACKLOG is null and
group by, 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

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”