public static function getFieldMax($db, $table, $field)
    {
        $field = new SwatDBField($field, 'integer');

        $sql = sprintf(
            'select max(%s) as %s from %s',
            $field->name,
            $field->name,
            $table
        );

        return self::queryOne($db, $sql);
    }