sourcecode

ssp 심플 클래스에서 UNION ALL을 사용하는 방법?

copyscript 2023. 10. 16. 21:59
반응형

ssp 심플 클래스에서 UNION ALL을 사용하는 방법?

ssp2 simple class에서 아래 SQL 쿼리를 사용하고 싶습니다.

 select * from table1 UNION ALL select * from table2

나는 아래 쿼리를 시도했습니다.ssp::simple class하지만 작동하지 않습니다.

$table ='';

$joinQuery = ' from table1 UNION ALL table2';

return Ssp::simple($_POST, $this->sql_details, $table, $primaryKey, $columns, 
       $joinQuery, $filterQuery, null, null, null);

참고: 사용하고 있습니다.Xampp 5.6.24(MariaDB)

$joinQuery = 'table1 UNION ALL table2' 대신 joinQuery를 바꿉니다;

    $joinQuery  = ' from (SELECT * from `table1` ';
    $joinQuery .= ' UNION ALL';
    $joinQuery .= ' SELECT * from `table2` ) temp';

언급URL : https://stackoverflow.com/questions/50366030/how-to-use-union-all-in-ssp-simple-class

반응형