我通过这样的方式将数据从 PharmacyData 复制到 fl_admin:
INSERT INTO fl_admin (first_name, last_name, email)
SELECT ContactFirstName, ContactLastName, ContactEmail FROM PharmacyData
同时,我想在 fl_admin 中填充另一个名为“type”的列,其值为“pharmacy”。如何在同一个 SQL 语句中执行此操作?
INSERT INTO fl_admin (type, first_name, last_name, email)
SELECT 'pharmacy', ContactFirstName, ContactLastName, ContactEmail FROM PharmacyData
INSERT INTO fl_admin (type, first_name, last_name, email) SELECT 'pharmacy', ContactFirstName, ContactLastName, ContactEmail FROM PharmacyData
我只是这样做
INSERT INTO fl_admin (first_name, last_name, email, type)
SELECT ContactFirstName, ContactLastName, ContactEmail, 'pharmacy' FROM PharmacyData