modified to accept hostname and connect to the network
[csql.git] / test / sql / Aggregate / test005.ksh
blobbac1fe63479119da00457c461317ceab57740c6b
1 #!/bin/sh
2 #Test Case
3 #5. Create table t1 with 5 records in csql database.
4 # select query with count,sum,avg,min,max.and Group By.
6 # Author : Jitendra Lenka
8 QUITFILE=${PWD}/sql/Aggregate/quit.sql
9 REL_PATH=.
10 if [ -s "$QUITFILE" ]
11 then
12 REL_PATH=`pwd`/sql/Aggregate
15 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/createt1t2.sql > /dev/null 2>&1
16 if [ $? -ne 0 ]
17 then
18 exit 1;
21 echo "select max(t1.f1), sum(t2.f1) from t1, t2 where t1.f1 = t2.f1 and t1.f1 <100 group by t1.f1 :"
22 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/groupby1.sql
23 if [ $? -ne 0 ]
24 then
25 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql > /dev/null 2>&1
26 exit 2;
27 fi
29 echo "select max(t1.f1), sum(t2.f1) from t1, t2 where t1.f1 = t2.f1 and t1.f1 <100 group by t1.f1, t2.f1 :"
30 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/groupby2.sql
31 if [ $? -ne 0 ]
32 then
33 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql > /dev/null 2>&1
34 exit 3;
35 fi
39 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql > /dev/null 2>&1
40 exit 0;