mysql 判断 字段是否为空

SB.Append("select ");

SB.Append("mpe.EVIDENCE_ID ");

SB.Append("left join media_private_evidence mpe on mpe.BAITAI_NO=ec.BAITAI_NO ");

if (vo.imgCondition != "-1")
{
if (vo.imgCondition == "0")
{
SB.Append("and ");
SB.Append("EVIDENCE_ID IS NULL ");
}
if (vo.imgCondition == "1")
{
SB.Append("and ");
SB.Append("LENGTH(EVIDENCE_ID) >0 ");

}
}

原文地址:https://www.cnblogs.com/xdot/p/4785294.html