similarity

select count("range"),"range" from

(

select

case

when match > 500 and match <= 550 then '501 - 550'
when match > 550 and match <= 600 then '550 - 600'
when match > 600 and match <= 650 then '600 - 650'
when match > 650 and match <= 700 then '650 - 700'
when match > 700 and match <= 750 then '700 - 750'
when match > 750 and match <= 800 then '750 - 800'
when match > 800 and match <= 850 then '800 - 850'
when match > 850 and match <= 900 then '850 - 900'
when match > 900 and match <= 950 then '900 - 950'
when match > 950 and match <= 1000 then '950 - 1000'
end
AS "range" from spectra a, bin b where a.bin_id = b.bin_id and b.export = 'FALSE'
)
a group by "range"

purity

select count("range"),"range" from

(

select

case

when a.purity > 0 and a.purity <= 0.1 then '0 - 0.1'
when a.purity > 0.1 and a.purity <= 0.5 then '0.1 - 0.5'
when a.purity > 0.5 and a.purity <= 0.9 then '0.5 - 0.9'
when a.purity > 0.9 and a.purity <= 1.3 then '0.9 - 1.3'
when a.purity > 1.3 and a.purity <= 1.7 then '1.3 - 1.7'
when a.purity > 1.7 and a.purity <= 2.1 then '1.7 - 2.1'
when a.purity > 2.1 and a.purity <= 2.5 then '2.1 - 2.5'
when a.purity > 2.5 then '> 2.5'

end

AS "range" from spectra a, bin b where a.bin_id = b.bin_id and b.export = 'TRUE'

)

a group by "range"

signal noise