ljsq.net
当前位置:首页 >> mysql类似于JAVA中switCh CAsE用法的语法 >>

mysql类似于JAVA中switCh CAsE用法的语法

mysql不太熟,不过你的要求就是简单嵌套就行了吧。 select @sum_rece:=s1+s2+s3+s4...+s10 from ( select (case when rece_day1 is null then rece_amt1 else 0) s1, (case when rece_day2 is null then rece_amt2 else 0) s2, 。。。。 from ...

mysql的case 就是 类似switch的用法, SELECT id,case status WHEN '0' then '审核中' WHEN '1' then '通过' WHEN '3' then '禁用' end as "status" from tp_user if的用法: select *,if(sex=1,"男","女") as sex from tp_user

set 不能连续的赋值。 case 语句也有错误。 可以改为: declare @grade int,@result varchar(10) set @grade=78 set @result= case when @grade=60 and @grade =70 and @grade=80 and @grade=90 and @grade

$mysqli 你定义了吗? 如:$mysqli = new mysqli($host, $user, $pass, $db);

function CheckUser($username,$password){ $sql = "select * from table where username='$username' and password='$password'";$result = mysql_query($sql);$row = mysql_num_rows($result); if($row != 0){ return true; }else{ return fal...

网站首页 | 网站地图
All rights reserved Powered by www.ljsq.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com