SELECT * FROM tableFoo
LEFT JOIN tableBar ON tableFoo.commonColumn = tableBar.commonColumn
WHERE tableBar.commonColumn IS NULL
Above will select records, I would like to insert Code below will insert id to third table.
INSERT IGNORE INTO jos_mt_links (link_id,link_name,alias)
VALUES(NULL,'tex2','hello'); # generate ID by inserting NULL
INSERT INTO jos_mt_cl (link_id,cat_id)
VALUES(LAST_INSERT_ID(),'88'); # use ID in second table
Nasıl bu kadar birleştirmek mi? Thx
Yine, ben tohether bu sorguları birleştirmek nasıl, burada bu not eklemek. Ilk sorgu dahil hepsi, (SELECT * ....)
Something like this: SELECT records, then insert them, and also insert this....