improve: query for getVideosNearMilestone
This commit is contained in:
parent
1f6411b512
commit
10b761e3db
@ -6,8 +6,16 @@ export async function getVideosNearMilestone(client: Client) {
|
|||||||
const queryResult = await client.queryObject<LatestSnapshotType>(`
|
const queryResult = await client.queryObject<LatestSnapshotType>(`
|
||||||
SELECT ls.*
|
SELECT ls.*
|
||||||
FROM latest_video_snapshot ls
|
FROM latest_video_snapshot ls
|
||||||
|
RIGHT JOIN songs ON songs.aid = ls.aid
|
||||||
WHERE
|
WHERE
|
||||||
(views >= 5000 AND views < 100000) OR
|
(views >= 50000 AND views < 100000) OR
|
||||||
|
(views >= 900000 AND views < 1000000) OR
|
||||||
|
(views >= 9900000 AND views < 10000000)
|
||||||
|
UNION
|
||||||
|
SELECT ls.*
|
||||||
|
FROM latest_video_snapshot ls
|
||||||
|
WHERE
|
||||||
|
(views >= 90000 AND views < 100000) OR
|
||||||
(views >= 900000 AND views < 1000000) OR
|
(views >= 900000 AND views < 1000000) OR
|
||||||
(views >= 9900000 AND views < 10000000)
|
(views >= 9900000 AND views < 10000000)
|
||||||
`);
|
`);
|
||||||
|
Loading…
Reference in New Issue
Block a user