将Google BigQuery查询翻译为Sqlite3

时间:2012-11-25 04:41:09

标签: sql sqlite google-bigquery

我有以下BigQuery查询运行良好:

SELECT created_at, actor_attributes_email, type FROM [githubarchive:github.timeline]
  WHERE 
  (repository_name="rubinius") AND
    (created_at CONTAINS '2011-') AND
  type !='WatchEvent'
ORDER BY created_at;

但是,现在我需要在Sqlite3中执行相同的查询。我需要做哪些改变才能使其发挥作用?

1 个答案:

答案 0 :(得分:1)

此查询中SQLite不支持的唯一非标准功能是CONTAINS;将其替换为created_at LIKE '%2011-%',或者如果该值保证以年份开头,则使用created_at LIKE '2011-%'