magento2 bergabung dengan tabel dengan awalan

function getColumns($table,$prefix)
{
    $resource = $GLOBALS['obj']->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $sql = "SHOW COLUMNS FROM `$table`;";
    echo $sql;
    $result = $connection->fetchAll($sql);
    $columns = array();
    for ($i = 0; $i < count($result); $i++) {
        array_push($columns,$result[$i]['Field']." as ".$prefix.$result[$i]['Field']);
    }
    return $columns;
}
Dharmesh Tukadiya