Skip to content

Instantly share code, notes, and snippets.

@jmelloy
Created June 28, 2013 21:47
Show Gist options
  • Save jmelloy/5888416 to your computer and use it in GitHub Desktop.
Save jmelloy/5888416 to your computer and use it in GitHub Desktop.
select pdbcode, pdbchain, cnt, other_col
from pdbcode a,
(select pdbcode, count(*) cnt
from pdbcode
group by pdbcode) b
where a.pdbcode = b.pdbcode
@lennax
Copy link

lennax commented Jun 28, 2013

SELECT pdbcode, pdbchain, n_chain, uniprotkbac, mc_skip, pisces FROM pdb
JOIN (SELECT pdbcode, count(pdbchain) AS n_chain FROM pdb GROUP BY pdbcode)
USING (pdbcode);

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