我目前正在使用 SQLite,我对这个查询感到害怕
SELECT Cur.Name, SUM(Cur.Added+Cur.Removed) AS Lines, COUNT(DISTINCT(Cur.Author)) AS authCurrent,
( SELECT COUNT(DISTINCT(Author))
FROM Change
WHERE Extencion = "java" AND
Date >= date('2012-04-08') AND
Date < date('2012-04-15')
) AS totCurrent
FROM
Change AS Cur,
( SELECT a.Name, COUNT(DISTICT(a.Author)) AS authLast
FROM Change AS a
WHERE a.Extencion = "java" AND
a.Date >= date('2012-04-08') AND
a.Date < date('2012-04-15')
GROUP BY a.Name ) AS Previous
WHERE
Previous.Name = Cur.Name
Cur.Extencion = "java" AND
Cur.Date >= date('2012-04-15') AND
Cur.Date < date('2012-04-22')
GROUP BY Cur.Name
它说“查询错误:靠近“Cur”:语法错误无法执行语句”我不知道,是不是因为SQLite不支持嵌套查询而导致查询不可执行?
无论如何,表更改具有以下形式
Author | Path | Extencion | Name | Date | Added | Removed