How to execute multiple SQL queries in MySQL Workbench?

后端 未结 2 568
清歌不尽
清歌不尽 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 17:54

    You could use Ctrl+Shift+Enter to run everything with semicolon end.

    For Mac +shift+return

    0 讨论(0)
  • 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;
    
    0 讨论(0)
提交回复
热议问题