Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能从一个 sql 查询中填充一个集合吗?我无法让我的语法正常工作
设置 c = [从联系人限制 1000 中选择 id];
谢谢!
您需要声明集合的类型,并使用将列表作为参数的集合构造函数,为您提供如下内容:
Set<Contact> c = new Set<Contact>( [SELECT Id, Name FROM Contact LIMIT 1000] );