日期:2014-05-18 浏览次数:20428 次
create function biantolunscore returns @score1 (int) begin select 刊物级别 as 刊物级别 , --这缺个逗号 case when 刊物级别='核心期刊' then 100 when 刊物级别='一般期刊' then 90 when 刊物级别='报纸杂志' then 80 when 刊物级别='会议论文' then 70 end as score from 论文 end --这缺个end
------解决方案--------------------
CREATE TABLE chen ( id int, title varchar(20), types varchar(20) ) INSERT INTO chen(id,title,types)VALUES(1,'第一刊物','核心期刊') INSERT INTO chen(id,title,types)VALUES(2,'第二刊物','报纸杂志') INSERT INTO chen(id,title,types)VALUES(3,'第三刊物','一般期刊') INSERT INTO chen(id,title,types)VALUES(4,'第四刊物','核心期刊') INSERT INTO chen(id,title,types)VALUES(5,'第五刊物','报纸杂志') INSERT INTO chen(id,title,types)VALUES(6,'第六刊物','报纸杂志') INSERT INTO chen(id,title,types)VALUES(7,'第七刊物','一般期刊') INSERT INTO chen(id,title,types)VALUES(8,'第八刊物','会议论文') INSERT INTO chen(id,title,types)VALUES(9,'第九刊物','会议论文') INSERT INTO chen(id,title,types)VALUES(10,'第十刊物','核心期刊')