How to insert multiple rows in single insert statement?

前端 未结 3 1557
执念已碎
执念已碎 2020-12-11 21:09

I have 5 text box contaning 5 contact no of a particular person. I want to insert those 5 contact no in tblContact(person_id|contact_no). Can I insert these 5

3条回答
  •  独厮守ぢ
    2020-12-11 21:26

    INSERT INTO `tblContact` (`person_id`, `contact_no`) VALUES
    ('PERSON_ID_VALUE_1', 'CONTACT_NO_VALUE_1'),
    ('PERSON_ID_VALUE_2', 'CONTACT_NO_VALUE_2'),
    ('PERSON_ID_VALUE_3', 'CONTACT_NO_VALUE_3'),
    ('PERSON_ID_VALUE_4', 'CONTACT_NO_VALUE_4'),
    ('PERSON_ID_VALUE_5', 'CONTACT_NO_VALUE_5');
    

提交回复
热议问题