1

我想在 ssp2 简单类中使用下面的 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)

4

1 回答 1

0

替换您的 joinQuery 而不是 $joinQuery = ' from table1 UNION ALL table2';

    $joinQuery  = ' from (SELECT * from `table1` ';
    $joinQuery .= ' UNION ALL';
    $joinQuery .= ' SELECT * from `table2` ) temp';
于 2018-05-16T09:37:13.757 回答