[text] Tell me you suck at SQL without telling me you suck at SQL new result set output 1 loop through results and narrow down based on arg terms foreach results as iditem loop through each arg foreach args as key argterms loop through each arg term foreach argterms as argterm i check if arg term exists in result if stristritemdefskey11 .argterm. outputid resultsid continue 2 b return new result set return output