Make SQL Select same row multiple times

后端 未结 11 2176
南方客
南方客 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 16:44

    You can use the UNION ALL statement.

    Try something like:

    SELECT * FROM tablename WHERE ID = 5469
    UNION ALL
    SELECT * FROM tablename WHERE ID = 5469
    

    You'd have to repeat the SELECT statement a bunch of times but you could write a bit of VB code in Access to create a dynamic SQL statement and then execute it. Not pretty but it should work.

提交回复
热议问题