Compute averages for two distinct sets from one table in a single query – Postgresql
I have a query to show the average length of all the proteins which also exists in a second table mrna_pieces: SELECT AVG(protein_length) FROM protein WHERE exists (SELECT protein_id FROM mrna_pieces WHERE mrna_brokstukken.protein_id = protein.protein_id) I also want to show…