|
为了limit方便我用了CI的内置函数来查询oracle数据库,需要连接查询,在mysql里面我们通常要将表取一个简称方便编写,可是总是报错如下
$this->db->select('*');
$this->db->from('BLOCKS AS b');
$this->db->join('NEWSS AS n','b.NEWS_ID=n.NEWS_ID');
$this->db->where("n.STATUS=0 and SYMBOL='".$symbol."'");
$this->db->orderby("ORDER_NUM","ASC");
$this->db->limit($num);
$query=$this->db->get();
结果输出这样的
SELECT * FROM (select inner_query.*, rownum rnum FROM (SELECT * AS title FROM "BLOCKS" AS b JOIN "NEWSS" AS n ON "b"."NEWS_ID"="n"."NEWS_ID" WHERE "n"."STATUS=0" and SYMBOL='bignews' ORDER BY ORDER_NUM ASC ) inner_query WHERE rownum < 10)
怎么form后面的表都有双引号啊 这样报错啊
求高手解答!!! 谢谢 |
|