Joke Collection Website - News headlines - The sql statement adds a column to the table and sets the default value.

The sql statement adds a column to the table and sets the default value.

Change table table1addcol1intdefault0.

[code = "Java "] Select (

Account_id=''

Then' empty'

When the account ID is empty

Then' empty'

ELSE account _id

End?

) account id

From where? Account?

Where account_id = 'XXX' or account_id ='' or (account_id is empty) [/code]

Extended data:

SQL default value is a default data of non-empty field data in the database. When setting the default value, the field is set to be non-empty, but no value is given when inserting data, and the database will automatically insert it with the default value. If you insert values normally, you need to add passwords manually, but if there are a large number of fields that can use default values, the statement is a bit bloated. Set the default value of the password field.

Create? Table? Stu (

stuId? varchar2(30)? Elementary? Keys,

stuName? varchar2(50)? Isn't it? Empty,

Stusykes? char(2)? Check (stuSex? In ('male',' female')? Default? Male? -There are no default properties in Oracle?

Stuge? Quantity (2)? Check (stuAge? & gt 1),

stuJg? varchar2(30),? -Hometown

stuDept? varchar 2(40));

Baidu Encyclopedia-Structured Query Language