public static function columnExpression($name, $type = 'char')
    {
        $sql = '[[' . static::dynamicColumn() . ']]';
        $parts = explode('.', $name);
        $lastPart = array_pop($parts);
        foreach ($parts as $column) {
            $sql = "COLUMN_GET($sql, '$column' AS BINARY)";
        }
        $sql = "COLUMN_GET($sql, '$lastPart' AS $type)";

        return $sql;
    }