Using an array or dictionary as from clause in sql in excel vba

后端 未结 3 1939
醉梦人生
醉梦人生 2021-01-21 19:35

Is it possible to use an array or dictionary as the table in a SQL statement.

e.g. strSQL = \"SELECT * FROM \" & myArray & \"\"

Thanks in advance.

3条回答
  •  不知归路
    2021-01-21 19:54

    SQL array like search function:

    SELECT TABLEARRAY.*
    FROM (
        SELECT P.*
        FROM Person P
        WHERE P.id IN (1, 2, 3, 4, 18) --This would be your array with ID's
         ) AS TABLEARRAY
    

提交回复
热议问题