Skip to content

Instantly share code, notes, and snippets.

@tinogis
Last active August 29, 2015 14:19
Show Gist options
  • Save tinogis/61ddcc80d63481166ac0 to your computer and use it in GitHub Desktop.
Save tinogis/61ddcc80d63481166ac0 to your computer and use it in GitHub Desktop.
SELECT
c.id,c.state,
split_part(c.name,'(',2) AS contador,
split_part(c.ref2,',',2) AS id_contador,
c.description,
m.name
FROM crm_case AS c
LEFT JOIN giscedata_lectures_comptador m ON (m.id=split_part(c.ref2,',',2)::int)
WHERE state='open' AND description LIKE '%lecturas_diferentes_encontradas%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment