Mysql query za prebacivanje iz jedne u drugu tablicu

Zdravo, imam 2 tablice u jednoj bazi podataka. Radi se o joomli i 2 blog sustava. Sada bi ja prebacio sve članke iz jednog blog sustava u drugi (odredište je zadani joomla blog sustav)
Prvo ću ukratko objasniti šta i kako pa ću dati svoj primjer.
Imam 2 tablice (ovo sql je prefix), i trebam prebaciti recimo naziv_knjige i opis iz sql_podaci u sql_knjige, ostalo ne trebam prebaciti jer su različiti:

sql_podaci (id, naziv_knjige, opis, xyz, zyy)
sql_knjige (knjiga_id, naziv_knjige, opis, zxy, yyz)

znam da se to radi preko INSERT INTO … SELECT … FROM ali meni nešto neće da radi.

Evo sad mog primjera.

odakle trebam kopirati: K2 blog sustav za joomlu: m7h_k2_items
gdje trebam ubaciti/kopirati: joomla zadani blog sustav: m7h_content
(m7h je prefix)

koristim ova 2 primjera ali nijedan ne radi:

insert into m7h_content (id, title, alias, catid, introtext, fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, modified, modified_by, publish_up, publish_down, access, featured, hits, language) select id, title, alias, catid, introtext, fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, modified, modified_by, publish_up, publish_down, access, featured, hits, language from m7h_k2_items


INSERT INTO `m7h_content` (id, title, alias, catid, introtext, fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, modified, modified_by, publish_up, publish_down, access, featured, hits, language) SELECT id AS id, title AS title , alias AS alias , catidA S catidA , introtext AS introtext , fulltext AS fulltext , created AS created , created_by AS created_by , created_by_alias AS created_by_alias , checked_out AS checked_out , checked_out_time AS checked_out_time , modified AS modified , modified_by AS modified_by , publish_up AS publish_up , publish_down AS publish_down , access AS access , featured AS featured , hits AS hits , language AS language
FROM `m7h_k2_items`

Greška koju dobivam (u phpmyadminu) je ova

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, ’ at line 1

SELECT stavi u zagradu i prije zagrade stavi VALUES, nije ti dobra sintaksa od inserta, pa vidi jel sve ok.

sta god da probam dobijem istu gresku, znaci nesto nije u redu sa insertom ali ne vidim sta, to bi trebalo biti ovako:

INSERT INTO tablica2 (nazivi_kolona)
SELECT nazivi_kolona
FROM tablica2

a tako je i kod mene

ovaj query koji si napisao jednostavno nema smisla…
trpas u tablicu2 nazive kolona iz tablice2?

ok napravio sam gresku prilikom pisanja, nisam ni prvi ni zadnji da se to nekome dogodilo

INSERT INTO tablica1 (nazivi_kolona)
SELECT nazivi_kolona
FROM tablica2

Jesi probao ovako…

    INSERT INTO tablica1 (nazivi_kolona) VALUES
(SELECT nazivi_kolona
FROM tablica2)

uspio sam s ovim queryjem (dodao sam ove ‘cudne’ apostrofe) i sada sve ok radi, mogu uci u clanak, vidjeti ga itd… 80% posla obavljeno (naspram rucnog copy-paste)

INSERT INTO  `joomla`.`m7h_content` (`id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`)
SELECT `id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`
FROM  `joomla`.`m7h_k2_items`

Copyright © 2022 WM Forum - AboutContact