Q:

auto-refreshing MySQL query on Linux commandline

I would like to see a auto refreshing MySQL query result in my linux console.
something like this:
while [ 1 ]
do
clear
//some special way of executing 'select id from updates order by id desc limit 1'
sleep 1
done

Thanks

A:

Something like the following should work:
watch -n 1 "mysql -e 'select id from updates order by id desc limit 1' your_db"

