📜  如何在 sql 查询中选择所有字段 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:30.047000             🧑  作者: Mango

代码示例1
// This is the object for which we required data.
Map fieldMap = Opportunity.sObjectType.getDescribe().fields.getMap();
  
// Get all of the fields on the object
Set fieldNames = fieldMap.keySet();
 
// Build a Dynamic Query String.
List opps = Database.query('select ' + string.join(fieldNames, ',') + ' from Opportunity');