I would like to execute the below SQL query for one of my requirement. How to do

I would like to execute the below SQL query for one of my requirement. How to do it through the queryEntity?

select max(column) from tablename where filedname=1 and filedname=2

Thanks in advance.

OriginalPostID-211372

OriginalPostID-211372

  Discussion posts and replies are publicly visible

Parents
  • Hi Rama try with the below code
    a!queryEntity(
    entity: cons!Entity_constant,
    query: a!query(
    aggregation: a!queryAggregation(aggregationColumns: {
    a!queryAggregationColumn(field: "column1", isGrouping: true),
    a!queryAggregationColumn(field: "column2", aggregationFunction: "MAX")
    }),                    
                        logicalExpression:
    a!queryLogicalExpression(
    operator: "AND",
    filters: {
                                   a!queryFilter(field: "fileld_name1", operator: "=", value: 1),
                                   a!queryFilter(field: "fileld_name2", operator: "=", value: 2)}),
                                   ,
    pagingInfo: local!pagingInfo
                                  
                                  ))
Reply
  • Hi Rama try with the below code
    a!queryEntity(
    entity: cons!Entity_constant,
    query: a!query(
    aggregation: a!queryAggregation(aggregationColumns: {
    a!queryAggregationColumn(field: "column1", isGrouping: true),
    a!queryAggregationColumn(field: "column2", aggregationFunction: "MAX")
    }),                    
                        logicalExpression:
    a!queryLogicalExpression(
    operator: "AND",
    filters: {
                                   a!queryFilter(field: "fileld_name1", operator: "=", value: 1),
                                   a!queryFilter(field: "fileld_name2", operator: "=", value: 2)}),
                                   ,
    pagingInfo: local!pagingInfo
                                  
                                  ))
Children
No Data