Skip to content

Instantly share code, notes, and snippets.

@hackimov
Created July 8, 2020 06:02
Show Gist options
  • Save hackimov/1bc71b0622bc353bc30b9ed2fd605ea5 to your computer and use it in GitHub Desktop.
Save hackimov/1bc71b0622bc353bc30b9ed2fd605ea5 to your computer and use it in GitHub Desktop.
select from database
SELECT CAST(document_data::json->>'EmpowermentId' AS char(24)) as internal_id, document_id from documents where
doctype_id = '945dde7f-b55e-4666-990c-749751a3c726'
and document_id <> CAST(document_data::json->>'EmpowermentId' AS char(24))
and CAST(document_data::json->>'EmpowermentId' AS char(24)) <> ' '
and CAST(document_data::json->>'EmpowermentId' AS char(24)) IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment