欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > 数据库 >内容正文

数据库

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

发布时间:2024/4/13 数据库 25 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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";

}

总结

以上是生活随笔为你收集整理的mysql 中eq_表达式中的运算符EQ NE GT GE LT LE…..的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。