Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My objective is to load data from a table and then create new columns. The problem is that I cannot create the columns on my database because i only have read permissions permissions (and cannot create procedures).
I have a table with columns:
SELECT id, date_terminated
FROM otrs.ticket;
What I want is to create a new table with the columns:
id,
date_terminated,
Jan_2014,
Fev_2014,
Mar_2014,
...,
Dez_2016 (for now but eventually i´ll have id from 2017, so more columns)
and then fill it with 1 or 0, for each line, if date_terminated < last day of the month
then 1 else 0
Not entirely sure, but are you looking for this?