" to "->", which indicates that MySQL has not seen the complete statement and is waiting for the rest of the statement . When it gets the semicolon, MySQL executes the statement. It can be understood through the following example - example mysql>SelectId,Name ->From ->Student_info &n"/> " to "->", which indicates that MySQL has not seen the complete statement and is waiting for the rest of the statement . When it gets the semicolon, MySQL executes the statement. It can be understood through the following example - example mysql>SelectId,Name ->From ->Student_info &n">

Home >Database >Mysql Tutorial >How does MySQL evaluate statements written on different lines?

How does MySQL evaluate statements written on different lines?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBforward
2023-09-08 23:41:021428browse

How does MySQL evaluate statements written on different lines?

#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 -

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete