Yanıtlar:
Birkaç yol:
# Comment
-- Comment
/* Comment */
Sonra boşluk bırakmayı-- unutmayın .
Belgelere bakın .
"Bir sütun için bir açıklama COMMENTseçeneği ile belirtilebilir . Yorum, SHOW CREATE TABLEve ile görüntülenir.SHOW FULL COLUMNS ifadeleri . Bu seçenek MySQL 4.1'den itibaren çalışır. (Önceki sürümlerde izin verilir ancak yok sayılır.)"
Örnek olarak
--
-- Table structure for table 'accesslog'
--
CREATE TABLE accesslog (
aid int(10) NOT NULL auto_increment COMMENT 'unique ID for each access entry',
title varchar(255) default NULL COMMENT 'the title of the page being accessed',
path varchar(255) default NULL COMMENT 'the local path of teh page being accessed',
....
) TYPE=MyISAM;
Üç tür yorum desteklenmektedir
# Kullanarak karma tabanlı tek satır yorumlama
Select * from users ; # this will list users
Select * from users ; -- this will list users
Not: Hemen ardından tek bir boşluk olması önemlidir -
3) / * * / kullanarak çok satırlı yorum
Select * from users ; /* this will list users */
/* comment here */
işte bir örnek: SELECT 1 /* this is an in-line comment */ + 1;
--