Excel: Use a cell value as a parameter for a SQL query

后端 未结 4 1909

I\'m using MS Excel to get data from a MySQL database through ODBC.
I successfully get data using an SQL query. But now I want that query to be parameterized.
So I w

4条回答
  •  广开言路
    2020-11-27 14:43

    I had the same problem as you, Noboby can understand me, But I solved it in this way.

    SELECT NAME, TELEFONE, DATA
    FROM   [sheet1$a1:q633]
    WHERE  NAME IN (SELECT * FROM  [sheet2$a1:a2])
    

    you need insert a parameter in other sheet, the SQL will consider that information like as database, then you can select the information and compare them into parameter you like.

提交回复
热议问题