How to store count of multiple queries in variables in a shell script?

how to store the count of queries in variables inside a filein shell script

my output :

filename
-------
variable1=result from 1st query
variable2=result from 2nd query
.
.
.
.

Are you able to elaborate on your question?

i wnat to store the count value from a query to a variable and then store the result in a file:

inside my result file my output should be:

variable1=result of query1(it will be a number)
variable2=result of query2(it will be a number)
.
.
.

variable1=$("select count(*) from table") && echo "variable1="${variable1}"" >> file.txt

You should use the relevant flag on your SQL for suppressing column headers etc. If you are using DB2, the option is -x .