SQL code: SELECT a1.FileID AS FileID, SUM( a1.Count + a2.Count + a3.Count + a4.Count ) AS Count from gmpTableWordList AS a1 INNER JOIN gmpTableWordList AS a2 INNER JOIN gmpTableWordList AS a3 INNER JOIN gmpTableWordList AS a4 ON a1.FileID = a2.FileID AND a2.FileID = a3.FileID AND a3.FileID = a4.FileID AND a1.Word = "Tempest" AND a2.Word = "EMC" AND a3.Word = "shielding" AND a4.Word = "glass" GROUP BY FileID ORDER BY Count DESC LIMIT 0 , 30
这在MYSQL下能顺利执行,但在SQLite下不行,搜索了一下相关文档,应该是sqlite不支持这种查询方式。请高手帮帮忙,把以上代码转成sqlite能执行的语句,其中a1,a2,a3.....的多少是跟据Word的多少来决定的,目前只是Tempest,EMC,shielding,glass.谢谢了!在线等.应该支持啊。你的表 gmpTableWordList 的建表语句是什么?贴出来大家可以测试一下。 提示什么 建表语句是这个: SQL code: CREATE TABLE gmpTableWordList (Word varchar(50) NOT NULL, FileID int(10) NOT NULL, Count INTEGER UNSIGNED)") or die("创建表失败!");
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT 然后删除数据库中的若干重复记录后ID变的不连续,如何变得连续?? 运行 ALTER TABLE tablename DROP id; ALTER TABLE tablename ADD id INT NOT NULL PRIMARY KEY ......