mysql 和 oracle sql 方言之间的主要区别是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7283828/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are the major differences between the mysql and oracle sql dialects?
提问by Yashima
I am a software developer. I have used mysql for years and now I am about to have my first encounter with oracle in a project.
我是一名软件开发人员。我已经使用 mysql 多年了,现在我将在一个项目中第一次遇到 oracle。
I was just told that I should be careful that the sql behaves quite differently in some cases. I have no idea what to expect. I am mostly looking for obvious stuff and typical beginner mistakes.
我只是被告知我应该小心在某些情况下 sql 的行为完全不同。我不知道会发生什么。我主要是在寻找明显的东西和典型的初学者错误。
For example I was told that oracle as no auto increment.
例如,有人告诉我 oracle 没有自动增量。
That's the type of stuff I am looking for. I'd be grateful for any further knowledge that helps avoid creating new solutions to problems already solved.
这就是我正在寻找的东西类型。如果您有任何进一步的知识可以帮助避免为已经解决的问题创建新的解决方案,我将不胜感激。
回答by duffymo
For example I was told that oracle as no auto increment.
例如,有人告诉我 oracle 没有自动增量。
Oracle has sequences; it's just a different notation. The idea of a column value that's automatically incremented on INSERT is certainly there.
Oracle 有序列;这只是一种不同的符号。在 INSERT 上自动递增的列值的想法肯定存在。
Oracle will have you add primary and foreign keys as constraints, separate from the table definition.
Oracle 会让您添加主键和外键作为约束,与表定义分开。
PostgreSQL is the closest thing to Oracle among the open source databases. It, too, has sequences.
在开源数据库中,PostgreSQL 是最接近 Oracle 的。它也有序列。
回答by Ivar Bonsaksen
Grouping is a major difference, as MySQL has its own non-standard interpretation of grouping. So if you're using a lot of clever grouping, you might find that Oracle will not execute your queries.
分组是一个主要区别,因为 MySQL 对分组有自己的非标准解释。因此,如果您使用了很多巧妙的分组,您可能会发现 Oracle 不会执行您的查询。
http://dev.mysql.com/doc/refman/5.6/en/group-by-hidden-columns.html
http://dev.mysql.com/doc/refman/5.6/en/group-by-hidden-columns.html