MySQL can use the slash to use the name of the field
Today, it was discovered that MySQL can use slashes as the name of a field.This was an unexpected discovery.
CREATE TABLE `op_day` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL DEFAULT '0000-00-00' COMMENT'DATE',
`income` int(11) NOT NULL DEFAULT '0',
`total` int (11) NOT NULL DEFAULT '0',
`income/total` double(11,2) NOT NULL DEFAULT '0.00',
PRIMARY KEY (`id`),
KEY `unique` (`date`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
The code is as follows:
CREATE TABLE `op_day` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` date NOT NULL DEFAULT '0000-00-00' COMMENT'DATE',
`income` int(11) NOT NULL DEFAULT '0',
`total` int (11) NOT NULL DEFAULT '0',
`income/total` double(11,2) NOT NULL DEFAULT '0.00',
PRIMARY KEY (`id`),
KEY `unique` (`date`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
0 Comments