#In fact, MySQL determines the end of the statement when it gets the terminating semicolon. Suppose we write a statement in a different line, then immediately after writing the first line, MySQL changes from "mysql>" to "->", which indicates that MySQL has not seen the complete statement and is waiting for the rest of the statement . When it gets a semicolon, MySQL executes the statement. It can be understood through the following example -
mysql> Select Id, Name -> From -> Student_info -> ; +------+---------+ | Id | Name | +------+---------+ | 101 | YashPal | | 105 | Gaurav | | 125 | Raman | | 130 | Ram | | 132 | Shyam | | 133 | Mohan | | 150 | Saurabh | +------+---------+ 7 rows in set (0.07 sec)
The above is the detailed content of How does MySQL evaluate statements written on different lines?. For more information, please follow other related articles on the PHP Chinese website!