How can i transpose this table?

gowthamanrajendran

04-02-2020

 

ID  FirstName LastName Email

1   Name1       Name12    Email1

2   Name2       Name22    Email2

3   Name3       Name32    Email3

 

i want to convert above table into

 

ID   AttributeName   AttributeValue

1     FirstName        Name1

1     LastName        Name12

1     Email                Email1

2     FirstName        Name2

2     LastName        Name22

2     Email                Email2

Adobe Campaign Adobe Campaign Classic

Accepted Solutions (1)

Accepted Solutions (1)

wodnicki

MVP

04-02-2020

Hi,

 

Repeat insert statements for each of your cols:

  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'FirstName', FirstName from old_table
  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'LastName', LastName from old_table
  • insert into new_eav_table (ID, AttributeName, AttributeValue)
    select ID, 'Email', Email from old_table 

 

You can also do this with select->update->update->update in a workflow.

 

Thanks,

-Jon

Answers (0)