THINKPHP处理临时表该如何操作

浏览:5602 发布日期:2015/01/12 分类:求助交流
我用sql拼了一个sql语句如:

create temporary table tmp_table
SELECT b.*,p.price,b.num*p.price as totalprice,p.name
FROM buycart as b
left join product as p on b.pid = p.id
where b.id=1 or b.id=2 or b.id=4 ;
select SUM(totalprice) as totalprice,GROUP_CONCAT(name separator'-') as name from tmp_table;

创建了临时表,然后从临时表中查询了数据.
用空model执行sql后报错了.SQLSTATE[HY000]: General error
请问该怎么处理呢?
我现在急着用 都不知道咋办了.
最佳答案
评论( 相关
后面还有条评论,点击查看>>