如何在ssp简单类中使用union all?

oknrviil  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(236)

我想在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 (马里亚布)

niknxzdl

niknxzdl1#

替换joinquery而不是$joinquery='from table1 union all table2';

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

相关问题