#!/bin/bash

ARANGE=1000
AINTERVAL=100
ACOUNT=50000
NUMRUN=300


i=0
while [ $i -lt $NUMRUN ] 
do
    RANDNUM=`echo $((1 + $RANDOM % 10))`
    
    cat <<EOF >> rand.sql
select 	count(*),  b from t1 where a > $RANDNUM group by b;
EOF
    i=$[$i+1]

done

echo "Performing $NUMRUN selects ..."
cat rand.sql | ./chkclt > /dev/null
echo "Done"
