Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> MySQL

MySQL: Data Type สำหรับเก็บสตริงยาว (Large Strings) คือ TEXT


เก็บสตริงยาว ใช้ Data Type TEXT

Syntax

CREATE TABLE yourTableName (yourColumnName TEXT, ...);

ตัวอย่าง

mysql> CREATE TABLE DemoTable (MyStringValue TEXT);
mysql> INSERT INTO DemoTable VALUES ('This is a text data type to store large string');

ผลลัพธ์

+------------------------------------------------+
| MyStringValue                                  |
+------------------------------------------------+
| This is a text data type to store large string |
+------------------------------------------------+