I don't understand why these query with column time gives me error. I think concatenation string (||) doesn't like it.
Could you help me please?
SQL Error [1791] [42000]: ORA-01791: not a SELECTed expression
select distinct b.ty||';'||b.mem||';'||a.jjj||';'||a.time||';'||a.dc||';'||a.etim||';'||a.oid||';'||a.app||';'||
case when stat = 345 then 'valid'
when stat = 5667 then 'INVALID'
else to_char(stat)
END ||';'||ext_sec/60||';'||a.gr||';'||a.ta
from runinfo_history a INNER JOIN def_job b
on a.ta=b.parent_table
inner join def_tables dt
on a.dc = dt.dc
and a.ta = dt.ta
and a.dc = dt.dc
and dt.id = b.id
and a.jjj=b.job_name
WHERE
to_char(time,'YYYYMMDD') = to_char(current_date,'YYYYMMDD')
and a.dc in ('SERVER') order by time DESC ;