Create table 订单
(
订单ID int primary key not null,
业务员ID int,
订购日期 DateTime,
发货日期 DateTime,
运货费 Money check(运货费>0),
货主名称 varchar(10),
check(订购日期<发货日期)
)
(
订单ID int primary key not null,
业务员ID int,
订购日期 DateTime,
发货日期 DateTime,
运货费 Money check(运货费>0),
货主名称 varchar(10),
check(订购日期<发货日期)
)
能否给我解释下, 为什么要把"check(订购日期<发货日期)"放到最底下呢?
[ database_name.[ owner ] .| owner.] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > ::= [ CONSTRAINT constraint_name ] } | [ { PRIMARY KEY | UNIQUE } [ ,...n ]
)
< table_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
{ ( column [ ASC | DESC ] [ ,...n ] ) }
[ WITH FILLFACTOR = fillfactor ]
[ ON { filegroup | DEFAULT } ]
]
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
| CHECK [ NOT FOR REPLICATION ]
( search_conditions )
}