![]() |
|
FireBird Merge Into Kullanımı - Baskı Önizleme +- Delphi Can (https://www.delphican.com) +-- Forum: Veri Tabanı (https://www.delphican.com/forumdisplay.php?fid=4) +--- Forum: FireBird (https://www.delphican.com/forumdisplay.php?fid=13) +--- Konu Başlığı: FireBird Merge Into Kullanımı (/showthread.php?tid=2546) |
FireBird Merge Into Kullanımı - mcuyan - 11-08-2018 Merhabalar arkadaşlar. Bu kısa makalemde FireBird de Merge Into Kullanımını anlatacağım. (SQL de biraz zayıf olduğum için bu tür ilginç öğrenimlerimi sizlerle paylaşmak istemiştim.) A tablosundaki kayıtları, verilen kritere uygun olarak B tablosundaki başka bir alana göre update edebilmek için merge into kullanılır.. A tablosundaki id ile B tablosundaki id eşleştiğinde, B tablosundaki ad ve soyad alanlarını A tablosundaki yerlerine yazar. Kullanımı: merge into ATablosu a using BTablosu b on a.a_id=b.b_id when matched then update set a.a_ad=b.b_ad, a.a_soyad=b.b_soyad FireBird Merge Into Kullanımı - edo - 13-08-2018 Merge komutu RDBMS'lerde bir tablo ya da sorgunun sonuçları ile bir başka tablonun kayıtlarını update ya da insert etmek için kullanılır. Firebird'ün kendi sitesindeki örnekler daha açıklayıcı duruyor, ayrıca verdiğiniz örnekte ifadenin sadece update kısmı var, insert kısmı ise yok. merge into books b using purchases p on p.title = b.title and p.type = 'bk' when matched then update set b.desc = b.desc || '; ' || p.desc when not matched then insert (title, desc, bought) values (p.title, p.desc, p.bought) merge into customers c using (select * from customers_delta where id > 10) cd on (c.id = cd.id) when matched then update set name = cd.name when not matched then insert (id, name) values (cd.id, cd.name) FireBird Merge Into Kullanımı - mcuyan - 13-08-2018 Düzeltme için teşekkürler.. |