How to execute multiple SQL queries in MySQL Workbench?

后端 未结 2 569
清歌不尽
清歌不尽 2021-01-07 17:34

I am using MySQL Workbench CE for Windows version 5.2.40.

I want to execute the following SQL queries together. However I can only execute the SQL queries by first e

2条回答
  •  执笔经年
    2021-01-07 18:14

    Add a semicolon after each statement:

    CREATE TABLE testTable(
        Name VARCHAR(20),
        Address VARCHAR(50),
        Gender VARCHAR(10)
    );
    
    INSERT INTO testTable
    VALUES
    ('Derp', 'ForeverAlone Street', 'Male'),
    ('Derpina', 'Whiterun Breezehome', 'Female');
    
    SELECT * FROM testTable;
    

提交回复
热议问题