Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- count(distinct cd.id) filter(where prd.id is not null) prd_match,
- count(distinct cd.id) total
- FROM "compound_detail" cd
- LEFT JOIN chemhost.product prd
- ON prd.cas = cd.cas
- WHERE cd.cas is not null;
- SELECT
- count(distinct prd.id) filter(where cd.id is not null) chem_match,
- count(distinct prd.id) filter(where prd.cas is not null and prd.cas != '' and prd.cas !~ '[nN]/?[Aa]') total_have_cas,
- count(distinct prd.id) total
- FROM chemhost.product prd
- LEFT JOIN "compound_detail" cd
- ON prd.cas = cd.cas;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement