Make SQL Select same row multiple times

后端 未结 11 2167
南方客
南方客 2020-12-11 16:02

I need to test my mail server. How can I make a Select statement that selects say ID=5469 a thousand times.

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 17:07

    Create a helper table for this purpose:
    JUST_NUMBER(NUM INT primary key)
    Insert (with the help of some (VB) script) numbers from 1 to N. Then execute this unjoined query:

    SELECT  MYTABLE.*
    FROM    MYTABLE,
            JUST_NUMBER
    WHERE   MYTABLE.ID = 5469 
        AND JUST_NUMBER.NUM <= 1000
    

提交回复
热议问题