0
Good morning.
I created a view
to pick up concatenated data from multiple columns.
CREATE
ALGORITHM = UNDEFINED
DEFINER = `root`@`localhost`
SQL SECURITY DEFINER
VIEW `canal` AS
SELECT
`a`.`id_campaign` AS `id_campaign`,
`a`.`state` AS `state`,
CONCAT('id_dialing_list_number_',
`b`.`id_dialing_list`) AS `Num_Lista`
FROM
(`campaign` `a`
JOIN `campaign_dialing_list` `b` ON (`a`.`id_campaign` = `b`.`id_campaign`))
WHERE
`a`.`state` = '3'
And give me back that data:
d_campaign,state,Num_Lista
100,3,id_dialing_list_number_74
100,3,id_dialing_list_number_186
209,3,id_dialing_list_number_185
209,3,id_dialing_list_number_115
211,3,id_dialing_list_number_237
213,3,id_dialing_list_number_68
210,3,id_dialing_list_number_89
214,3,id_dialing_list_number_354
212,3,id_dialing_list_number_156
217,3,id_dialing_list_number_163
I’d like to take from the column Num_lista
and update these respective tables.
Someone could give me a light?.
Grateful.