The explanation is, that the arguments to the "db2" command are first seen by your shell (bash). Parentheses and double quotes are special characters for bash (and several others as well), and the construct "count(*)" is invalid bash syntax, which explains the error message.
Originally Posted by laxman babu
To avoid such problems (and to avoid detailed knowledge about bash special characters), place your SQL statement in a file, and pass that file's name as argument to the "db2 -f" command.
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting