|
发表于 2014-5-19 16:03:46
|
显示全部楼层
$query = $this->db->query("
set @n=0;
set @f=0;
select * from
(select title,@n:=if(@f=pid,@n:=@n+1,1) as id,@f:=pid as pid from product where pid in(257,209) order by pid,addtime desc)
a
where id <8
");
查询的语法是,select * from 表名,你这个from 后面跟这么长的是要作为where 条件用吗?个人感觉的的括号内的东西,没有使用,然后还放错了位置。 |
|