MySQL提供一台冰操作员<=>
,该仪器可包含一种可包含如下内容的不成文:null <=> 无
或null <=> 5
等等,给许多方案拟定语言的反馈结果。 正常的平等经营人总是只取得回报,而这种回报却赶走了许多新的MySQL用户,如我本人。
MySQL是否具备以下功能:<=>
? 谁真正需要一个没有用语言类型建造的经营者?
MySQL提供一台冰操作员<=>
,该仪器可包含一种可包含如下内容的不成文:null <=> 无
或null <=> 5
等等,给许多方案拟定语言的反馈结果。 正常的平等经营人总是只取得回报,而这种回报却赶走了许多新的MySQL用户,如我本人。
MySQL是否具备以下功能:<=>
? 谁真正需要一个没有用语言类型建造的经营者?
谁真正需要一个没有用语言类型建造的经营者?
You asked for some real-world examples. Here s a spurious one. Let s say that you have a residential youth programme or similar, and one of the requirements is that the kids only share a room with someone of the same sex. You have a nullable M/F field in your database - nullable because your data feed is incomplete (you re still chasing down some of the data). Your room-matching code should definitely not match students where t1.Gender<=>t2.Gender, because it could end up matching two kids of unknown gender, who might be of opposite genders. Instead, you match where they re equal and not both null.
That s just one example. I admit that the behaviour of NULL
and the =
operator have caused a lot of confusion over the years, but ultimately the fault probably lies with the plethora of online MySQL tutorials that make no mention of how NULL
interacts with operators, nor of the existence of the <=>
operator.
我的SQL语和节目编排语言的“无效”之间的巨大差异是,在我的SQL中,“无”一词是指un known。 在制定方案时,这意味着un specified数值。
In mySQL, null does not equal null (unknown does not equal unknown). While in programming languages, null does equal null (undefined equals undefined).
Who really needs an operator that is effectively undefined with built in language types?
您也需要在您的数据库内建立关系。 尤其是,如果你利用外国的关键制约因素的话。
for example if you have a table for tasks (in your company). then you assign these tasks to employees. so you have a relation from your tasks-table to your employees-table.
and there will always be some unassigned tasks. in this case the field in your tasks-table you use for the relation to the employees table will contain NULL
.
this will make sure, that this task is unassigned. which means: there is no possibility that there is a relation to the employees table.
如果NULL = NUL
将true
,那么,举例来说,雇员表中的外国钥匙也总是有可能成为NUL
。 因此,这项任务将分配给一名或多名雇员。 你们永远无法知道某项任务被指派给某些雇员。
是的。
This must be because relational databases use the theory of three-valued logic (TRUE
, NULL
, FALSE
).
而三维 l必须努力,因为它必须是内部的。
依据的是数学规则。
Is there a reason MySql has both and not JUST the functionality in <=> ? The operators are completely different from each other.
<代码><=> 进行平等比较,如<代码>=的操作者,但<代码>1。 两种操作方式均为NUL
和0
。 缩略语
Who really needs an operator that is effectively undefined with built in language types?
This depends on case, just because you haven t encountered such cases, does not mean nobody needs it.
当<代码><=> 无效的等同操作者与NOT
的操作者结合时,该编码适合实际使用世界的情况。 返回记录如不停:
<编码> WHERE NOT d或mant_status <=> Y
相当于
或
WHERE d或mant_status <> Y OR d或mant_status IS NULL
I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
我把我的用心从使用QQL转向MySQL。 它与凯科特合作,现在不工作,因为我已经改变,使用MySQL。 这里的错误信息是:
We have a restaurant table that has lat-long data for each row. We need to write a query that performs a search to find all restaurants within the provided radius e.g. 1 mile, 5 miles etc. We have ...
Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...
Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...
What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...
My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...