SQLite Query using nested SELECT
You should always use WHERE xxx IN (SELECT xxx FROM ...)
, instead of selecting multiple items in the inner select. You can add those in the outer select though, for example:
SELECT DISTINCT mgc_version, test_type_letter, design_index, test_index, cpu_time, multi_thread FROM TestExecutionsWHERE cpu_time IN ( SELECT DISTINCT cpu_time FROM TestExecutions WHERE test_type_letter BETWEEN $testletter AND $testletter)