The sql should be
select max(id),Staff_name from position group by Staff_name
I modify the ssp.class.php
.
SELECT SQL_CALC_FOUND_ROWS ".implode(", ", self::pluck($columns, 'db'))."
FROM $table
$where
$order
$limit group by Staff_name.
However, it dose not work. How to realize this sql?
SOLUTION
Class
ssp.class.php
doesn't supportJOIN
,GROUP BY
or sub-queries, but there is a workaround. The trick is to use sub-query as shown below in$table
definition in you server-side processing script (server_processing.php
).For example:
You also need to edit
ssp.class.php
and replace all instances ofFROM `$table`
withFROM $table
to remove backticks.NOTES
There is also github.com/emran/ssp repository that contains enhanced
ssp.class.php
supportingJOIN
andGROUP BY
.LINKS
See jQuery DataTables: Using WHERE, JOIN and GROUP BY with ssp.class.php for more information.