简体   繁体   English

什么在 SOQL 中是可能的,但在 SQL 中是不可能的?

[英]What is possible in SOQL but not in SQL?

Are there any functions / keywords / syntax in SOQL queries that does NOT have an equivalent operation in SQL? SOQL 查询中是否有任何函数/关键字/语法在 SQL 中没有等效操作?

Basically, does there exist a SOQL query that you couldn't convert directly into a SQL query?基本上,是否存在无法直接转换为 SQL 查询的 SOQL 查询?

Some differences of SOQL: SOQL的一些区别:

No SELECT *没有 SELECT *

No views没有意见

SOQL read-only SOQL 只读

Limited indexes有限指标

Object-relational mapping is automatic对象关系映射是自动的

Schema changes protected架构更改受保护

Weird question, why do you ask?奇怪的问题,为什么这么问? And which SQL you mean exactly, Oracle, SQL Server flavour, Maria DB or what?你指的是哪个 SQL、Oracle、SQL Server flavor、Maria DB 还是什么?

I'd say you'll have hard time我会说你会很难过

  • mapping SELECT Account.Owner.Manager.Profile.Name FROM Opportunity into "normal" joins映射SELECT Account.Owner.Manager.Profile.Name FROM Opportunity到“正常”连接
  • replicating TOLABEL() (translate picklist values on the fly)复制 TOLABEL()(即时转换选项列表值)
  • replicating anything SF-specific like WITH (say knowledge base's data categories) or USING SCOPE (you can pull "my accounts" but can you pull "my team's accounts"? "My territory's accounts"? Without an orgy of joins)复制任何特定于 SF 的东西,比如WITH (比如知识库的数据类别)或USING SCOPE (你可以提取“我的账户”但你可以提取“我的团队的账户”吗?“我的领土的账户”?没有加入的狂欢)
  • doing joins over mutant polymorphic fields like Task.WhatId or ContentDocumentLink.LinkedEntityId加入 突变 多态字段,如Task.WhatIdContentDocumentLink.LinkedEntityId
  • doing any kind of SOSL, especially if org uses synonyms做任何类型的 SOSL,特别是如果组织使用同义词
  • converting currencies on the fly即时转换货币
  • doing things like FISCAL_YEAR() without orgy of joins to Period table做 FISCAL_YEAR() 之类的事情而不狂欢加入 Period 表
  • replicating any geolocation-related queries (accounts up to 10 km away from me) without knowing exactly what GIS (or whatever) SF uses在不知道 SF 使用什么 GIS(或其他什么)的情况下复制任何与地理位置相关的查询(距离我最多 10 公里)
  • doing soft deletes (or however Recycle Bin really works) without impact on performance.在不影响性能的情况下进行软删除(或者回收站确实有效)。 I mean if records go to another table - columns are identical and join/view happens magically when you query ALL ROWS?我的意思是如果将 go 记录到另一个表 - 列是相同的并且当您查询所有行时加入/查看会神奇地发生吗?
  • doing any Person Account stuff, silently querying and updating effectively 2 tables (as materialised view maybe?)做任何个人账户的事情,默默地有效地查询和更新 2 个表(可能是物化视图?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM