现有一个SQL语句。怎么用TP的SQL方式写出来。
selectb.*from(SELECTmax(id)idFROMaccesslogsWHEREloginuserid>0groupBYloginuserid)aLEFT...
select b.* from (SELECT max(id) id FROM accesslogs WHERE loginuserid > 0 group BY loginuserid) a LEFT JOIN accesslogs b ON a.id=b.id order by id desc;
select b.* from (SELECT max(id) id FROM accesslogs WHERE loginuserid > 0 group BY loginuserid) a,accesslogs b where a.id=b.id order by id desc;
我想用TP的格式吧这两个语句写出来。
类似于
$count=$this->Accesslogs_obj
->alias("a")
->join(C ( 'DB_PREFIX' )."posts b ON a.object_id = b.id")
->where($where)
->count();
$page = $this->page($count, 20);
$posts=$this->Accesslogs_obj
->alias("a")
->join(C ( 'DB_PREFIX' )."posts b ON a.object_id = b.id")
->where($where)
->limit($page->firstRow . ',' . $page->listRows)
->order("a.listorder ASC,b.post_modified DESC")->select();
这样 展开
select b.* from (SELECT max(id) id FROM accesslogs WHERE loginuserid > 0 group BY loginuserid) a,accesslogs b where a.id=b.id order by id desc;
我想用TP的格式吧这两个语句写出来。
类似于
$count=$this->Accesslogs_obj
->alias("a")
->join(C ( 'DB_PREFIX' )."posts b ON a.object_id = b.id")
->where($where)
->count();
$page = $this->page($count, 20);
$posts=$this->Accesslogs_obj
->alias("a")
->join(C ( 'DB_PREFIX' )."posts b ON a.object_id = b.id")
->where($where)
->limit($page->firstRow . ',' . $page->listRows)
->order("a.listorder ASC,b.post_modified DESC")->select();
这样 展开
2015-07-10
展开全部
function singplay() {
var self = this;
this.prefix = "sing_play__fm_";
this.playIndex = -1;
this.listIndex = { PlayList: 0, MusicBox: 1 };
this.isLogin = false;
this.countMusicbox = -1;
this.cookieList = { PlayList: this.prefix + "0", MusicBox: this.prefix + "1" };
this.cookie;
this.agent;
this.init();
var self = this;
this.prefix = "sing_play__fm_";
this.playIndex = -1;
this.listIndex = { PlayList: 0, MusicBox: 1 };
this.isLogin = false;
this.countMusicbox = -1;
this.cookieList = { PlayList: this.prefix + "0", MusicBox: this.prefix + "1" };
this.cookie;
this.agent;
this.init();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询