Skip to content

Instantly share code, notes, and snippets.

@utgwkk
Created May 15, 2021 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utgwkk/e3af094288afd2621d74b4628727eb6f to your computer and use it in GitHub Desktop.
Save utgwkk/e3af094288afd2621d74b4628727eb6f to your computer and use it in GitHub Desktop.
Quine in SQL (SQLite3)
with quine as (select 'with quine as (select %c%s%c as s) select printf(s, char(39), s, char(39)) from quine' as s) select printf(s, char(39), s, char(39)) from quine
@utgwkk
Copy link
Author

utgwkk commented May 15, 2021

% sqlite3 < quine.sql | tee out
with quine as (select 'with quine as (select %c%s%c as s) select printf(s, char(39), s, char(39)) from quine' as s) select printf(s, char(39), s, char(39)) from quine
% diff quine.sql out           
% 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment