mysql ... | awk '{ print "diff is", $0 }'
Or just
mysql ... 'SELECT CONCAT("diff is ", VALUE) FROM ...'
From within awk:
awk 'BEGIN { cmd = "mysql ..." }
{ cmd | getline value;
printf("diff is %d\n"%s\n", value); # or print "diff is", value;
close(cmd) }'
This will run the command once for each line of input to the awk script. Without the close(), it would be run once and give value the value of each successive output line of the command.
Your script uses $lastdiff rather than lastdiff with getline. In awk, $lastdiff refers to field number lastdiff of the current input record.