But wouldn’t that also get proteins which have peptides with masses both below and above the threshold?
For example
Protein_1 is chopped into Peptide_1a with a mass of 50, Peptide_1b with a mass of 80, and Peptide_1c with a mass of 90.
Protein_2 is chopped into Peptide_2a with a mass of 70 and Peptide_2b with a mass of 120.
My problem is to find those proteins where all the peptides with the same Protein_ID have masses below the threshold, let’s say 100.
So I would want Protein_1 but not Protein_2.
(The reason for doing this is that we can’t detect peptides below a certain mass so all proteins which are chopped into only small peptides can’t be detected by the given method. Chopping them up in a different way might help though; but the question remains: how many of the proteins can we not detect within a given experiment).
Protein_2 in the Peptides table has 2 rows . One row (mass = 70) meets your threshold and the other (mass = 100) doesn’t. The inner join criteria will only be met by the first row (mass = 70). So only that row is returned by the Inner Join, the other row doesn’t get returned as it fails the Inner Join.
[quote=105457:@Markus Winter]I think I got it (or something like it):
SELECT ProteinID
FROM tbl_Peptides
WHERE ProteinID NOT IN(
SELECT ProteinID
FROM tbl_Peptides
WHERE mass < 100 )
And I’m using SQLite[/quote]
Just to clarify, given your example criteria above, you did mean to write WHERE mass >= 100 as you wanted Proteins where all their Peptides had mass less than 100?