SQL code: select id, case when weight>volweight then weight else volweight end OUTweight from [Table]
SQL code: select id , OUTWeight = (case when Weight > VolWeight then Weight else VolWeight end ) from a
up SQL code: create table a (ID int,Weight int,VolWeight int) insert into a values(1 ,10, 6) insert into a values(2 ,5 ,8) insert into a values(3 ,1 ,3) insert into a values(4 ,12, 7) insert into a values(5 ,11, 2) insert into a values(6 ,3 ,5) go
--1 select id , OUTWeight = (case when Weight > VolWeight then Weight else VolWeight end ) from a
运行后报错误如下: 错误类型: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 '数学 + 4where 姓名='王静'' 中。 ......