COUNT MYSQL functions in Editor

COUNT MYSQL functions in Editor

solucionessoluciones Posts: 12Questions: 5Answers: 0

Hello,

How to add COUNT or SUM MSQL functions to MJoin. Is there any possibility?

I need average in field Datatable and use ajax call but the loading is slow

{ data: 'provider.id', render: function (data, type, row) {

$.ajax({
type: 'POST',
data: parametros,
url: 'php/get-average.php',
async: false,
success: function (response) {
average=response;
},
error: function (response) { }
});

return average;

} },

Answers

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin

    Rather than using a count, you could just use the .length property of the array that is returned from the server. In this case:

    { data: 'provider.id.length' }
    

    assuming provider.id is the array - it might be provider.length you need to use, but I'm not certain without being able to see the data.

    Allan

This discussion has been closed.