mysql 中eq_表达式中的运算符EQ NE GT GE LT LE…..

EQ NE GT GE LT LE

GT=Great Than >

EQ=Equal =

GE=Great and Equal >=

NE=Not Equal <>

//等运算符,如果运算符两边相同则返回真,否则返回假;

NE(Not Equal to)

//不等运算符,如果运算符两边不等则返回真,否则返回假;

GE(Greater than or equal to)

//大于等于运算符,如果运算符两边左边大于等于右边则返回真,否则返回假;

GT(Greater than)

//大于运算符,如果运算符两边左边大于右边则返回真,否则返回假;

LE(Less than or equal to)

//小于等于运算符,如果运算符两边左边小于等于右边则返回真,否则返回假;

LT(Less than)

//小于运算符,如果运算符两边左边大于右边则返回真,否则返回假;

类别 运算符

算术运算符 + 、 - 、 * 、 / (或 div )和 % (或 mod )

关系运算符 == (或 eq )、 != (或 ne )、 < (或 lt )、 > (或 gt )、 <= (或 le )和 >= (或 ge )

逻辑运算符 && (或 and )、 || (或 or )和 ! (或 not )

验证运算符 empty

参考及引用

7.2. String Comparison Operators

In order to compare for string equality, or if one string is alphabetically bigger than another, you can use the six string comparison operators. Here are the string operators together with the numerical operators they correspond too:

String Operator

Numerical Operator

eq

==

ne

!=

gt

>

lt

<

ge

>=

le

<=

Notice that the string operators are built from the initials of their abbreviated names. (E.g: eq = equal, gt = greater than). Perl’s string comparison is case-sensitive. If you want a case insensitive string comparison, use thelc function to convert the strings to lowercase beforehand.

Example:

print "Please enter your private name:\n";

$name = <>;

chomp($name);

if (lc($name) eq "rachel")

{

print "Your name is Rachel!\n";

}

else

{

print "Your name is not Rachel!\n";

}

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值