我在这里有这个代码,你可以从我的伪代码中看到我正在努力实现的目标
select *
from dbo.BenefitsForms
inner join Dependents on BenefitsForms.UserId = Dependents.BenefitsForm_UserId
inner join CoverageLevels on BenefitsForms.MedicalId = CoverageLevels.Id
where (BenefitsForms.MedicalId > 0 AND BenefitsForms.MedicalId < 13)
AND Dependents.IsSpouse = CASE when CoverageLevels.[Level] = 2 then 1
when CoverageLevels.[Level] = 3 then 0 end
when CoverageLevels.[Level] = 4 then [any, it doesnt matter] <--- my desire but it doesn't work.
Run Code Online (Sandbox Code Playgroud)
我怎样才能在括号中获得我想要的效果?如果Coverage Level = 4那么我不关心Dependents.IsSpouse是什么,我甚至不需要再按它排序了.
我试图隐藏非主页的页脚.以下是我的尝试,这是网站
.home #first {
width:950px;
margin-top:20px ;
border-top: 1px dotted #9bacd4;
background:#ff0000;
}
.home #first img {
margin:5px;
}
.home #first h3
{
font-size:16px;
font-weight:bold;
margin:5px 0px 15px 15px;
}
#first {
display:none;
}
Run Code Online (Sandbox Code Playgroud) 我在比较Mysql数据库中的两个值并显示最低值时遇到问题.
比如我有这个:
value1 = 23.4
value2 = 4.479
Run Code Online (Sandbox Code Playgroud)
我试过这个:
ORDER BY CAST(column AS SIGNED) ASC
Run Code Online (Sandbox Code Playgroud)
但它不起作用
同样,字段类型是VARCHAR.
我要找的结果应该是23.4而不是4.479
有什么建议?
假设如下
col1 col2 col3 col4
------+----------+---------+---------
abc | | |
Run Code Online (Sandbox Code Playgroud)
是的,col1-4中有空格!
我想选择不是空格的列. On row 1 it's col1, but on row 20 it may be col3, row 55 it may be col2, and so on. I need to return just that column.
There will always be only one column with a stored value within this range of four columns, I just need the one that actually has information in it.
This will be part of a greater query for …