Note how these two versions of (nearly) the same command will give different results:
tabtocsv bowtie-out.txt | namecolumns - | \
tssql '
select
col1,
count(*),
sum(if_then_else(col8 = "", 1, 0))
from `-`
group by col1 order by count(*) desc' > hits-per-probe.csv
tabtocsv bowtie-out.txt | namecolumns - | \
tssql '
select
col1 as probeID,
count(*) as matches,
sum(if_then_else(col8 = "", 1, 0)) as perfect_matches
from `-`
group by probeID order by count(*) desc' > hits-per-probe.csv
Note how these two versions of (nearly) the same command will give different results: