refactor: Simplify SQL

This commit is contained in:
Ahmad Ansori Palembani 2024-08-10 11:32:20 +07:00
parent 3af5aa8949
commit ec4afe874c
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -14,7 +14,6 @@ SELECT S.* FROM (
) AS S;
-- Replace seperator from ' & ' to less common ' [.] '
WITH tmp(_id, filtered_scanlators) AS (SELECT _id, replace(filtered_scanlators, ' & ', ' [.] ') FROM mangas)
UPDATE mangas
SET filtered_scanlators = (SELECT filtered_scanlators FROM tmp)
WHERE _id IN (SELECT _id FROM tmp);
SET filtered_scanlators = replace(filtered_scanlators, ' & ', ' [.] ')
WHERE filtered_scanlators IS NOT NULL;