开满天机
大概就是这个意思吧:--create table a (n bit,m bit,g bit,h bit,w bit,t bit);--insert into a(n,m,g,h,w,t)values(0,1,1,0,1,1),(1,0,0,1,0,0),(1,0,1,0,1,0);select case
when n=1 or m=1 then '主要问题'
when g=1 or h=1 then '次要问题'
when w=1 or t=1 then '次要问题'
else 'error' endfrom a;不太清楚N M 的值为1的时候 返回"主要问题" G H 为1的时候返回"次要问题" W T为1的时候返回"其他问题"这句话的具体意思,所以我就写成了这种or的关系。这种情况不需要写存储过程,直接的sql就行。