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

@@ -25,7 +25,7 @@ async function getFromDatabase({ artistId }) {
async function fetchAll() {
console.log("start fetching artists ...")
var artistIds = await dbUtils.query(`
SELECT DISTINCT artist_id FROM song_artist_relation WHERE artist_id NOT IN ( SELECT DISTINCT artist_id FROM artist )
SELECT DISTINCT artist_id FROM song_artist_relation WHERE artist_id NOT IN ( SELECT artist_id FROM artist )
`, []);
artistIds = artistIds.map(item => item.artist_id);
for (let i = 0; i < artistIds.length; i++) {