diff --git a/bin/p-spam-abc b/bin/p-spam-abc new file mode 100755 index 0000000000000000000000000000000000000000..b6416b2443b061d3cb9727ff4cc7adea264a1405 --- /dev/null +++ b/bin/p-spam-abc @@ -0,0 +1,26 @@ +#!/bin/bash +# Najde adresy účastníků kategorií A-C, kterým chceme poslat spam o MO-P + +YEAR=73 + +psql mo_osmo -q --csv -c " + select email from users + where user_id in ( + select user_id from participants + where year=$YEAR + and grade not in ('8/8', '4/4') + ) and user_id in ( + select user_id from participations + where contest_id in ( + select contest_id from contests + where round_id in ( + select round_id from rounds + where year=$YEAR + and category in ('A', 'B', 'C') + and seq=1 + ) + ) + ) and email not like '%@nomail' + and email not like '%@test' + order by email; +"