0

I have an ASP.NET page get request with url parameter of SQL for AJAX to get JSON response.

E.g.: url: 'GridService.aspx?query=SELECT VALUE s.Name, s.Email FROM ModelContainer.StudentSet AS s' will get information of Name and Email.

In order to implement the paging with jqGrid, I have to add total count of this query to the JSON response.

But the following query will not work with ESQL:

SELECT VALUE COUNT(0) FROM (SELECT VALUE s.Name, s.Email FROM ModelContainer.StudentSet AS s)

This is because two columns are selected in the child query. And the following could work:

SELECT VALUE COUNT(0) FROM (SELECT VALUE s FROM ModelContainer.StudentSet AS s)

Since I don't want to select unnecessary columns, I'm wondering if someone could give an example of making the former one work. Note that neither Name nor Email is PK.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Ovilia
  • 7,066
  • 12
  • 47
  • 70

0 Answers0