
That statement returns the exact syntax it would take to recreate the table, so if it requires using \n to put newlines in, that's what it will show.īut you can output the newlines as actual line breaks if you query the table metadata from the INFORMATION_SCHEMA: mysql> select * from information_schema. This comment is used at the end of the SQL query and must have a line break after it. We use to write a single-line comment in the MySQL query given below. Let’s create a table named tbteachers to practice MySQL comments.


Syntax: single line comment another comment SELECT FROM Customers Let’s see an example in which we have one table name Customers in which we are fetching all the data records. A line starting with ‘‘ is a comment and will not be executed. This is Command on macOS, Control on other platforms. We can use MySQL single-line comments in two ways, either by using or -. Comments starting and ending in a single line are considered single-line comments. The opening and terminating characters need not be separated from the. Run SQL » Result: The Try-MySQL Editor at . End the comment with an asterisk and a slash (/).

Get your own SQL server SQL Statement: x - Select all: SELECT FROM Customers Edit the SQL Statement, and click 'Run SQL' to see the result. Modifier in the tables stands for the platform-specific modifier key. The Try-MySQL Editor at MySQL Database: Restore Database. The comment will still appear as one long string if you use SHOW CREATE TABLE to view it. The following tables list keyboard shortcuts for MySQL Workbench commands. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='some really long string\nthat we want to span multiple lines\ninstead of being limited to a single line'
