Putting query result dynamically to one cell of table from shell

I have to send a data in mail table format.only one cell need to get dynamically from query.
my code is like

(echo '<table boarder="1">
echo '<tr><td>stock</td><td>/path</td><td>.........</td></tr>'
echo '</table>
)sendmail..

in ......... I am trying to get query result.By putting query directly it prints the query in mail body.I want the result to print

Knowing what operating system you're using, what shell you're using, what query language you're using to connect to your database, and what type of database you're using would give us a better chance of helping you solve this.

Showing us the query you plan to use to get data out of your database and the data you are trying to format into a mail message would also help.

Hi Don ,
I am using redhat 6.4 x86_64 os.and using mysql.Query will be like " hive -e "use db; set mapred.job.queue.name=dd;select max(date_ship) from db.table;" .I am using hql.I want the result of this hql will print on 3rd cell of table.The out put of query will be like "2016-08-08".