mdb tools sql query table name space separated

2019-09-07 06:53发布

I'm trying to make an ODBC query for my .mdb database. I'm using mdbtools driver. The code is written in C using Eclipse. The only problem is that when I write for example:

"SELECT 'last week' FROM MyTable GROUP"

it doesn't work cause it cannot recognize the space separator from the table field. I have no idea about the SQL syntax used by MDB tools driver.

MyTable fields are:

ID   jobs  last week  
1     ..      ...  
2  
...  

Any ideas?

1条回答
Luminary・发光体
2楼-- · 2019-09-07 07:48

To delimit names with spaces in them you need to use square brackets.

"SELECT [last week] FROM MyTable GROUP"

This also works for table names.

查看更多
登录 后发表回答