Writing down SQL query on Linux Terminal

I am using Linux user, so mainly use Linux terminal to run my SQL queries.
If I made a mistake while writing a query in multiple lines, how to move to previous line?
i.e., look at the figure attached, In which I made a mistake while writing my first line, how can i move up there to correct it in mutiline mode?


why not use sql workbench? Mosh will do stuff on stored procedures, views, permissions etc later so you will need it anyways

Thank you for your prompt response. I am also using workbench on my machine, but i also practice sometimes on terminal. By the way its OK.