# Function aggregation_query_fields

- aggregation_query_fields(
  table_name: string,
  aggregations: {
  [nm: string]: {
  aggregate: string;
  field?: string;
  valueFormula?: string;
  };
  },
  options?: { groupBy?: string | string[]; schema?: string; where?: Where },
  ): {
  fldNms: string[];
  groupBy: string[] | null;
  sql: string;
  values: Value[];
  where: string;
  }

  #### Parameters

  - table_name: string
  - aggregations: { [nm: string]: { aggregate: string; field?: string; valueFormula?: string } }
  - `Optional` options: { groupBy?: string | string[]; schema?: string; where?: Where }

  #### Returns {
  fldNms: string[];
  groupBy: string[] | null;
  sql: string;
  values: Value[];
  where: string;
  }

  - Defined in packages/saltcorn-data/models/internal/query.ts:170