Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create multiple columns? and then populate them

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

1 Solution

Accepted Solutions
sunny_talwar

Not entirely sure, but are you looking for this?

The Generic Load

View solution in original post

1 Reply
sunny_talwar

Not entirely sure, but are you looking for this?

The Generic Load