I have a relatively simple query already that works:
SELECT last("total") FROM "DB" WHERE ("type" = \'stats\' AND "name" =