Foxpro哪里表达无效?

Rob*_*Rob 2 sql foxpro where visual-foxpro

lcVillkor1 = "table.numbers > 1"

SELECT * FROM table WHERE lcVillkor1 ORDER BY table.numbers
Run Code Online (Sandbox Code Playgroud)

我收到了错误 - SQL: WHERE clause is invalid.

我几乎尝试了所有可能的组合

"table.numbers > 1", (table.numbers > 1), "(table.numbers > '1')" 等等..

我试图从一张桌子上打印一些帖子(数字大于1).

pmo*_*eri 10

&在变量之前使用以扩展它:

lcVillkor1 = "table.numbers > 1"

SELECT * FROM table WHERE &lcVillkor1 ORDER BY table.numbers
Run Code Online (Sandbox Code Playgroud)

  • @jerry :(变量)语法用于'名称表达式',它与宏替换相似但不相同 - 只有在FoxPro查找名称时才能使用它们.因此,如果表名存储在变量中,您可以说"SELECT*FROM(tablename)..." (3认同)