在 Sql 中,FROM 不应该出现在 SELECT 之前吗?

发布于 2024-10-18 06:52:50 字数 1700 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小耗子 2024-10-25 06:52:50

是的,这很奇怪而且违反直觉。休·达文(Hugh Darwen)对这种情况如何发生提出了理论:

你接受 SELECT-FROM-WHERE 吗?
当然,或者你像我一样找到它
很好奇 System R 团队
应该抛弃正常的方式
书写任意的表达
有利于某事物的复杂性
完全与众不同,而且,人们可能会
说,相当独裁......?

事实上,在 20 世纪 60 年代,各种
脚本语言(正如我们倾向于
这些天这样称呼)已经来了
出于报告目的
生成,特别是特别报告
一代。我们有一种这样的语言
在称为前关系型 DBMS 中
我的终端业务系统(TBS)
1969-77 年在 IBM 工作。我们的
需要用户指定的语言
一系列所需的报告
必须在中给出的步骤
规定的顺序
...

有点相似但更多
复杂的报告生成器是
后来由美国IBM公司开发,
称为产品的一部分(平淡地说,
就像当时 IBM 的风格)
通用信息系统
(GIS)...当我第一次看到 SQL 时,
我的第一反应是“哦不!
GIS 的儿子?请不要这样!”我
可能是完全错误的
这。我感知到的相似之处
可能是虚幻的,即使
不是,我没有确凿的证据
System R 团队中的任何人
熟悉GIS。事实依然如此
即一般风格固定
行动的顺序是
当时的一天。我假设
SQL 的 SELECT-FROM-WHERE 源于
这种时尚。

来自拥有错误的时间

Yes it is strange and counterintuitive. Hugh Darwen theorises about how this state of affairs came about:

Do you take SELECT-FROM-WHERE for
granted, or do you, like me, find it
rather curious that the System R team
should have spurned the normal way of
writing expressions of arbitrary
complexity in favour of something
utterly idiosyncratic and, one might
say, rather dictatorial...?

The fact is that in the 1960s various
scripting languages (as we tend to
call such things these days) had come
about for the purposes of report
generation, especially ad hoc report
generation. We had one such language
in the prerelational DBMS called
Terminal Business System (TBS) that I
worked on for IBM from 1969-77. Our
language required the user to specify
the required report in a series of
steps that had to be given in the
prescribed order
...

A somewhat similar but much more
sophisticated report generator was
later developed by IBM in the US, as
part of a product called (prosaically,
as was IBM's style in those days)
Generalized Information System
(GIS)... when I first looked at SQL,
my immediate reaction was "Oh no!
Son of GIS? Please not that!" I
might have been quite wrong about
this. The similarity I perceived
might have been illusory and even if
it was not, I have no firm evidence
that anybody in the System R team was
familiar with GIS. The fact remains
that the general style of a fixed
order of actions was the order of the
day at the time. I postulate that
SQL's SELECT-FROM-WHERE arose out of
this fashion.

From HAVING a Blunderful Time

寻找我们的幸福 2024-10-25 06:52:50

根据 唐纳德·D·张伯伦 (Donald D. Chamberlin) 的口述历史采访,其语法类似于英语:

这是我们第一次尝试将该语言完全基于
英文关键词让您可以从阅读查询中直观地了解英文单词。查询可能会这样说:“选择经理等于约翰·史密斯的员工的薪水。”从“select”、“from”和“where”等英文单词中,您可以很好地了解查询的内容。

The syntax was to resemble English, according to an oral history interview with Donald D. Chamberlin:

It was our first attempt to base the language exclusively on
English keywords so that you could read a query from an intuitive understanding of the English words. A query might say something like, ‘Select salary from employee where manager equals John Smith.’ From the English words like ‘select,’ ‘from’ and ‘where’, you can get a pretty good idea for what the query is about.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文