İlkay Genç

SQL’de Insert Yöntemleri

Insert Yöntemleri

Insert işlemleri için üç çeşit insert yöntemleri vardır biri genel olarak kullandığımız ikincisi SELECT UNION INSERT yöntemi ve son olarakta Row Construction yöntemi vardır. Yöntemlere örnek olarak;

database sql insert

1 – Genel Insert Kullanımı


INSERT INTO InsertYontemleri (id, Deger)VALUES (1, 'Birinci Değer');
INSERT INTO InsertYontemleri (id, Deger)VALUES (2, 'İkinci Değer');
INSERT INTO InsertYontemleri (id, Deger)VALUES (3, 'Üçüncü Değer');

2 – Select Union Insert Yöntemi

INSERT INTO InsertYontemleri (id, Deger)
SELECT 1, 'Birinci Değer'
UNION ALL
SELECT 2, 'İkinci Değer'
UNION ALL
SELECT 3, 'Üçüncü Değer';

3 – Row Construction Yöntemi

INSERT INTO InsertYontemleri (id, Deger)
VALUES (1, 'Birinci Değer'), (2, 'İkinci Değer'), (3, 'Üçüncü Değer');

SQL’de Daha fazlası için: http://ilkaygenc.com.tr/?s=sql

Yorum Yap