clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1305636 fiddles created (20297 in the last week).

-- setup CREATE TABLE example (content_id serial PRIMARY KEY, content text); CREATE TABLE test (id serial PRIMARY KEY, tags TEXT, content_id int REFERENCES example); CREATE UNIQUE INDEX ON example ((md5(content)::uuid)) INCLUDE (content_id); -- ! INSERT INTO example(content) VALUES (NULL); -- usage INSERT INTO example(content) VALUES ('some text'); INSERT INTO test (tags, content_id) SELECT 'some content defining tags', content_id FROM example WHERE md5(content)::uuid = md5('some text')::uuid;
1 rows affected
1 rows affected
1 rows affected
 hidden batch(es)


SELECT tags, content FROM test LEFT JOIN example USING (content_id);
tags content
some content defining tags some text
 hidden batch(es)