1👍
✅
Double the %
to escape it, as Django treats it as a format string where %
characters have special meaning:
SELECT distinct id, id FROM XX WHERE id LIKE '01%%' GROUP BY id
-- ^^
Source:stackexchange.com