Instead of using a semicolon (;) terminator symbol, is there any other built-in-commands which execute the MySQL query?

MySQLMySQLi Database

With the help of the following built-in commands, MySQL can execute a query even if semicolon (;) terminator symbol is not used.

ego

We can use this command by using \G option. It means to send the current statement to the server to be executed and display the result in vertical format. When we use \G and omitting semicolon(;) in a statement (single or multiple lines), MySQL determines the end of the statement as and when it encounters \G. Consider the example below −

mysql> Select * from ratelist\G
*************************** 1. row ***************************
   Sr: 1
 Item: A
Price: 502
*************************** 2. row ***************************
Sr: 2
Item: B
Price: 630
*************************** 3. row ***************************
   Sr: 3
 Item: C
Price: 1005
*************************** 4. row ***************************
   Sr: 4
 Item: h
Price: 850
*************************** 5. row ***************************
   Sr: 5
 Item: T
Price: 250
5 rows in set (0.00 sec)

go

We can use this command by using \g option. It means to send the current statement to the server to be executed. When we use \g and omitting semicolon (;) in a statement (single or multiple line), MySQL determines the end of the statement as and when it encounters \g. It gives the output in same format as we get by using semicolon (;). Consider the example below −

mysql> Select * from ratelist\g
+----+------+-------+
| Sr | Item | Price |
+----+------+-------+
|  1 | A    |   502 |
|  2 | B    |   630 |
|  3 | C    |  1005 |
|  4 | h    |   850 |
|  5 | T    |   250 |
+----+------+-------+
5 rows in set (0.00 sec)
raja
Published on 22-Feb-2018 06:07:00
Advertisements