table schema: create table if not exists `RIV_INBOUND_NOTICE_H`( `INH_ID` int(10) primary key auto_increment comment ""入库通知单头ID"", `INH_STATUS` smallint not null comment ""状态;10-已输入,20-已确认,90-已作废"", `INH_NOTICE_NO` varchar(40) not null comment ""入库通知单号"", `INH_OWNER_ID` int(10) not null comment ""货主ID"", `INH_ORG_ID` int(10) not null comment ""机构ID"", `INH_OWNER_NO` varchar(40) comment ""货主单号"", `INH_TX_TYPE_ID` int(10) not null comment ""入库事务类型ID;对应事务类型表"", `INH_VENDOR_ID` int(10) comment ""供应商ID;对应货主关联往来户表"", `INH_EXPECT_DATETIME` datetime comment ""预计入库日期时间"", `INH_TOTAL_GROSS_WEIGHT` decimal(18,6) not null default 0 comment ""总毛重"", `INH_TOTAL_NET_WEIGHT` decimal(18,6) not null default 0 comment ""总净重"", `INH_TOTAL_CUBAGE` decimal(18,6) not null default 0 comment ""总体积"", `INH_TOTAL_PACKS` int(10) not null default 0 comment ""总件数"", `INH_TOTAL_MONEY` decimal(18,6) not null default 0 comment ""总金额"", `INH_INPUT_DATETIME` datetime not null comment ""下单日期时间"", `INH_INPUT_USER_ID` int(10) not null comment ""下单操作员ID"", `INH_APPROVE_DATETIME` datetime comment ""确认日期时间"", `INH_APPROVE_USER_ID` int(10) comment ""确认用户ID"", `INH_FINISH_DATETIME` datetime comment ""完成日期时间"", `INH_FINISH_USER_ID` int(10) comment ""完成用户ID"", `INH_REMARK` varchar(400) comment ""备注"", `GEN_METHOD` varchar(40) not null comment ""资料生成方式:input - 手工输入,system - 系统自动生成,file - 从文件导入,interface - 从接口导入"", `CREATE_USER_ID` int(10) not null comment ""创建用户ID"", `CREATE_TIME` datetime not null comment ""创建时间"", `UPDATE_USER_ID` int(10) comment ""修改用户ID"", `UPDATE_TIME` timestamp comment ""修改时间"", `VERSION_NUMBER` int(10) not null default 0 comment ""版本号:新增资料为 0,每次修改加 1"" ) engine=innodb default charset=utf8 comment ""入库通知单头表""; query : SELECT create_time, create_user_id, gen_method, inh_approve_datetime, inh_approve_user_id, inh_expect_datetime, inh_finish_datetime, inh_finish_user_id, inh_id, inh_input_datetime, inh_input_user_id, inh_notice_no, inh_org_id, inh_owner_id, inh_owner_no, inh_remark, inh_status, inh_total_cubage, inh_total_gross_weight, inh_total_money, inh_total_net_weight, inh_total_packs, inh_tx_type_id, inh_vendor_id, update_time, update_user_id, version_number FROM riv_inbound_notice_h WHERE inh_notice_no = ""ASN20150220000002"" AND inh_input_datetime >= ""- -"" AND inh_input_datetime <= ""- -"" AND inh_expect_datetime >= ""- -"" AND inh_expect_datetime <= ""- -"" ORDER BY update_time DESC |
|
15分 |
MySQL 的文档 (Type Conversion in Expression Evaluation) 中提到,在做比较时,会按这样的规则进行必要的类型转换:
两个参数至少有一个是 NULL 时,比较的结果也是 NULL,例外是使用 <=> 对两个 NULL 做比较时会返回 1,这两种情况都不需要做类型转换 |
10分 |
show warnings;看告警
|
mysql> show warnings; |
|
15分 |
MYSQL的源代码肯定有的。 结论是转换成 char |
mysql> select convert(“”- -“”,char); mysql> select convert(“”- -“”,datetime); mysql> show warnings; 可不可以这么理解: SELECT create_time, create_user_id, gen_method, inh_approve_datetime, inh_approve_user_id, inh_expect_datetime, inh_finish_datetime, inh_finish_user_id, inh_id, inh_input_datetime, inh_input_user_id, inh_notice_no, inh_org_id, inh_owner_id, inh_owner_no, inh_remark, inh_status, inh_total_cubage, inh_total_gross_weight, inh_total_money, inh_total_net_weight, inh_total_packs, inh_tx_type_id, inh_vendor_id, update_time, update_user_id, version_number FROM riv_inbound_notice_h WHERE inh_notice_no = ""ASN20150220000002"" AND inh_input_datetime >= null AND inh_input_datetime <= null AND inh_expect_datetime >= null AND inh_expect_datetime <= null ORDER BY update_time DESC |
|
这个实验怎么做呢?求指导… |