Home > database >  How to change the invalid default values to effective
How to change the invalid default values to effective

Time:09-17


Always invalid default values

CodePudding user response:

Tried it on, the following is normal, what could you have such things as the Angle of comma.
In addition, I suggest you use navicat for mysql client, do not use this way, because it is too primitive way is very difficult to find syntax errors,
 SELECT a. d. eviceNumber, 
A. d. eviceName,
(SELECT b.i pAddress
The FROM MacIpAddress_t AS b
WHERE b.d eviceNumber=a. d. eviceNumber FOR JSON PATH) AS ipAddress
The FROM HardWareRecord_t AS a
WHERE a. d. eviceNumber='SGCG200326000033' - the main table

CodePudding user response:

The code is wrong, according to the following:
 CREATE TABLE xs (
Student number char (12) not null,
Name char (8) not null,
Gender char (2) the check (gender in (' male ', 'woman')),
Age varchar (20) not null,
Political landscape char (4) not null default 'league members'
);

CodePudding user response:

This depends on you what is the default character set,

If it is latin1 that can't be sure, if it is utf8 (or utf8mb4) that is no problem,

Look at the effect of the execution, respectively
The create table t1 (ZZMM char (4) not null default '1234') default charset=utf8;

The create table t2 (ZZMM char (4) not null default '1234') default charset=latin1;
  • Related