1
votes

Tabela episodes

  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_id` int(11) NOT NULL,
  `season` int(11) NOT NULL,
  `episode` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `embed` text NOT NULL,
  `date_added` date NOT NULL,
  `thumbnail` varchar(255) NOT NULL,
  `views` bigint(20) NOT NULL

Tabela embeds

  `id` int(11) NOT NULL AUTO_INCREMENT,
  `episode_id` int(11) NOT NULL,
  `embed` text NOT NULL

I want to insert embed data from table embeds to table episodes at field embed

1

1 Answers

0
votes

I assume that by "insert" you don't literally mean inserting rows, but updating existing rows by "inserting" data into a column.

update episodes set
embed = (
    select group_concat(embed)
    from embeds
    where episode_id = episodes.id
)