fix sql error in get alert function .