简体   繁体   English

如何在 Salesforce 的 SOQL 查询中使用 select *?

[英]How can i use select * in SOQL query in Salesforce?

I am trying to run a select in Salesforce as follows:我正在尝试在 Salesforce 中运行 select ,如下所示:

     SELECT [Account].* FROM [Account] WHERE [Account].Id IN ('123456789012345678')

but gives an error: "Unknown error parsing query" How can i do this selection?但给出一个错误:“未知错误解析查询”我该如何做这个选择?

SOQL is not SQL. SOQL 不是 SQL。 The SQL syntax you're using here is not valid in Salesforce.您在此处使用的 SQL 语法在 Salesforce 中无效。 You can learn the basics of SOQL in the Write SOQL Queries unit on Trailhead or the SOQL and SOSL Reference .您可以在 Trailhead 上的写入 SOQL 查询单元或SOQL 和 SOSL 参考中学习 SOQL 的基础知识。

Until the Spring '21 release of Salesforce, there is no support for a SELECT * wildcard.在 Salesforce 的 Spring '21 版本之前,不支持SELECT *通配符。 You must spell out all fields explicitly.您必须明确说明所有字段。 Once your org is upgraded to Spring '21 (the release is in progress as of this writing), you'll be able to use FIELDS(ALL) .一旦您的组织升级到 Spring '21(在撰写本文时该版本正在进行中),您将能够使用FIELDS(ALL) At that point, your query would look like this:此时,您的查询将如下所示:

 SELECT FIELDS(ALL) FROM Account WHERE Id IN ('123456789012345678') 

Note that you must be using API version 51.0 to connect to Salesforce in order to use this function.请注意,您必须使用 API 版本 51.0 连接到 Salesforce 才能使用此 function。 You may return up to 200 records.您最多可以返回 200 条记录。

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

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