MYSQL中的单等于 [英] Single Equals in MYSQL

查看:73
本文介绍了MYSQL中的单等于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么MYSQL在条件语句中使用单个等号而不是更典型的两个等号.是否有技术/历史原因?谢谢.

I was wondering why MYSQL uses a single equals sign in conditional statements instead of the more typical two equals signs. Is there a technical/historical reason for this? Thanks.

推荐答案

我想知道为什么MYSQL在条件语句中使用单个等号而不是更典型的两个等号.是否有技术/历史原因?谢谢.

Hi, I was wondering why MYSQL uses a single equals sign in conditional statements instead of the more typical two equals signs. Is there a technical/historical reason for this? Thanks.

SQL中的比较比赋值更常见.

Comparison is much more common in SQL than assignment.

这就是为什么SQL使用更短的语法来完成更多常见事情的原因.

That's why SQL uses more short syntax to do more common things.

在经典的SQL中,可以通过上下文将比较与赋值区分开(赋值只能在UPDATE语句的SET子句中),这就是为什么两个运算符都可以使用一个运算符的原因.

In classical SQL, comparison can be distinguished from assignment by context (assignment can be only in SET clause of an UPDATE statement), that's why one operator can be used for both operations.

MySQLSQL的扩展中,对会话变量的分配由:=

In MySQL's extension to SQL, assignment to a session variable is denoted by :=

这篇关于MYSQL中的单等于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆