SQL问题,急!(100分)

  • 主题发起人 主题发起人 zhourongbiao
  • 开始时间 开始时间
Z

zhourongbiao

Unregistered / Unconfirmed
GUEST, unregistred user!
我在一个别名为UserRecord的数据库下有index,yhda两个.db文件。
其中yhda含HouseNo,name SQL语句:
select name from yhda where HouseNo = 3 能正确执行
然而对含No,Address的index SQL语句:
select Address from index where No = 3 却提示invalid use of keyword 及token: index,这是怎么回事?
有人说是index文件名和关键字重复,可是我还有1.db,2.db等文件,将index换为1,2也是出现同样错误,只不过token变成1,2。
 
数据表名称或字段名称不要使用name,index之类,把它们改掉试试。
 
就是这样!
 
NO、INDEX、NAME等往往是保留字,最好不要用。
 
同意楼上
 
Index 不要作为表名和字段名
 
你先这样试试:
select Address from "index" where No = 3
不行的话,再来,加上文件扩展名:
select Address from "index.db" where No = 3
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
1K
import
I
I
回复
0
查看
456
import
I
后退
顶部