MySQL Benchmark

前端 未结 3 787
盖世英雄少女心
盖世英雄少女心 2021-01-02 05:35

I am trying to use MySQL benchmark to test some queries. But, I am running to an error.

SELECT benchmark (10000, (select title from user));
<
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-02 05:40

    select title from user
    

    This returns multiple rows, which won't work.

    Refer to this link: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_benchmark

    The expression you pass must return a scalar result.

    You need to change the query such that it returns a single row: ex:

    select title from user where user_name = 'some_user'
    

提交回复
热议问题