0

我通过这样的方式将数据从 PharmacyData 复制到 fl_admin:

INSERT INTO fl_admin (first_name, last_name, email)
    SELECT ContactFirstName, ContactLastName, ContactEmail FROM PharmacyData

同时,我想在 fl_admin 中填充另一个名为“type”的列,其值为“pharmacy”。如何在同一个 SQL 语句中执行此操作?

4

3 回答 3

1
INSERT INTO fl_admin (type, first_name, last_name, email)
    SELECT 'pharmacy', ContactFirstName, ContactLastName, ContactEmail FROM PharmacyData
于 2013-07-30T18:51:02.247 回答
0
INSERT INTO fl_admin (type, first_name, last_name, email) SELECT 'pharmacy', ContactFirstName, ContactLastName, ContactEmail FROM PharmacyData
于 2013-07-30T18:51:28.273 回答
0

我只是这样做

INSERT INTO fl_admin (first_name, last_name, email, type)
    SELECT ContactFirstName, ContactLastName, ContactEmail, 'pharmacy' FROM PharmacyData
于 2013-07-30T18:54:33.610 回答