1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

去掉 NOT IN 之后子查询的 DISTINCT

This commit is contained in:
2022-10-05 12:06:44 +08:00
parent b35918faef
commit 6c3a6d9aaf
3 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ const dbUtils = global.dbUtils;
async function fetchAll() {
console.log("start fetching lyrics ...");
var songIds = await dbUtils.query(`
SELECT DISTINCT song_id FROM song WHERE song_id NOT IN ( SELECT DISTINCT song_id FROM lyric )
SELECT DISTINCT song_id FROM song WHERE song_id NOT IN ( SELECT song_id FROM lyric )
`, []);
songIds = songIds.map(song => song.song_id);
for (let i = 0; i < songIds.length; i++) {