【问题标题】:What's wrong with my query and what does the error mean?我的查询有什么问题,错误是什么意思?
【发布时间】:2018-09-26 21:29:18
【问题描述】:

我不知道这个查询有什么问题以及错误的含义:

查询

select Total2014, Total2015
From 2014_Jan_Pivot
inner join 2015_Jan_Pivot on 2014_Jan_Pivot.PremiseCity2014= 
2015_Jan_Pivot.PremiseCity2015

错误说: 无法识别的令牌:“2014_Jan_Pivot”:选择 Total2014、Total2015、Total2016、Total2017 从 2014_Jan_Pivot

【问题讨论】:

  • 成功了!谢谢!!!

标签: sqlite inner-join


【解决方案1】:

您的问题是因为 SQLite 中的名称不能以数字/数字开头,除非它们被括起来。

所以 2014_Jan_Pivot 是无效的(也就是无法识别的)令牌。

但是,您可以附上名称,然后它将被识别,例如:-

[2014_Jan_Pivot] 
`2014_Jan_Pivot`
"2014_Jan_Pivot" or
'2014_Jan_Pivot'

所以您的查询可能是:-

SELECT 
    Total2014, 
    Total2015 
FROM [2014_Jan_Pivot] 
    INNER JOIN [2015_Jan_Pivot] ON 
        [2014_Jan_Pivot].PremiseCity2014 = [2015_Jan_Pivot].PremiseCity2015

【讨论】:

猜你喜欢
  • 2012-08-14
  • 1970-01-01
  • 1970-01-01
  • 2014-09-14
  • 1970-01-01
  • 2011-05-26
  • 2021-07-16
  • 2014-10-16
  • 1970-01-01
相关资源
最近更新 更多