bug #4444 No insert statement produced in SQL export for queries with alias

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>