您好,欢迎访问一九零五行业门户网

求一条sql话语

求一条sql语句。。
想了半天,也没个头绪不知道该怎么写。
我要查询discuz x2.0的三个表,分别是pre_forum_thread,pre_forum_attachment索引表,pre_forum_attachment_n的子表
sql codecreate table if not exists `pre_forum_thread` ( `tid` mediumint(8) unsigned not null auto_increment, `fid` mediumint(8) unsigned not null default '0', `posttableid` smallint(6) unsigned not null default '0', `typeid` smallint(6) unsigned not null default '0', `sortid` smallint(6) unsigned not null default '0', `readperm` tinyint(3) unsigned not null default '0', `price` smallint(6) not null default '0', `author` char(15) not null default '', `authorid` mediumint(8) unsigned not null default '0', `subject` char(80) not null default '', `dateline` int(10) unsigned not null default '0', `lastpost` int(10) unsigned not null default '0', `lastposter` char(15) not null default '', `views` int(10) unsigned not null default '0', `replies` mediumint(8) unsigned not null default '0', `displayorder` tinyint(1) not null default '0', `highlight` tinyint(1) not null default '0', `digest` tinyint(1) not null default '0', `rate` tinyint(1) not null default '0', `special` tinyint(1) not null default '0', `attachment` tinyint(1) not null default '0', `moderated` tinyint(1) not null default '0', `closed` mediumint(8) unsigned not null default '0', `stickreply` tinyint(1) unsigned not null default '0', `recommends` smallint(6) not null default '0', `recommend_add` smallint(6) not null default '0', `recommend_sub` smallint(6) not null default '0', `heats` int(10) unsigned not null default '0', `status` smallint(6) unsigned not null default '0', `isgroup` tinyint(1) not null default '0', `favtimes` mediumint(8) not null default '0', `sharetimes` mediumint(8) not null default '0', `stamp` tinyint(3) not null default '-1', `icon` tinyint(3) not null default '-1', `pushedaid` mediumint(8) not null default '0', `cover` smallint(6) not null default '0', `replycredit` smallint(6) not null default '0', primary key (`tid`), key `digest` (`digest`), key `sortid` (`sortid`), key `displayorder` (`fid`,`displayorder`,`lastpost`), key `typeid` (`fid`,`typeid`,`displayorder`,`lastpost`), key `recommends` (`recommends`), key `heats` (`heats`), key `authorid` (`authorid`), key `isgroup` (`isgroup`,`lastpost`), key `special` (`special`)) engine=myisam default charset=utf8 auto_increment=380 ;
pre_forum_attachment结构如下:
sql codecreate table if not exists `pre_forum_attachment` ( `aid` mediumint(8) unsigned not null auto_increment, `tid` mediumint(8) unsigned not null default '0', `pid` int(10) unsigned not null default '0', `uid` mediumint(8) unsigned not null default '0', `tableid` tinyint(1) unsigned not null default '0', `downloads` mediumint(8) not null default '0', primary key (`aid`), key `tid` (`tid`), key `pid` (`pid`), key `uid` (`uid`)) engine=myisam default charset=utf8 auto_increment=110 ;
pre_forum_attachment_n子表结构如下
sql codecreate table if not exists `pre_forum_attachment_0` ( `aid` mediumint(8) unsigned not null, `tid` mediumint(8) unsigned not null default '0', `pid` int(10) unsigned not null default '0', `uid` mediumint(8) unsigned not null default '0', `dateline` int(10) unsigned not null default '0', `filename` varchar(255) not null default '', `filesize` int(10) unsigned not null default '0', `attachment` varchar(255) not null default '', `remote` tinyint(1) unsigned not null default '0', `description` varchar(255) not null, `readperm` tinyint(3) unsigned not null default '0', `price` smallint(6) unsigned not null default '0', `isimage` tinyint(1) not null default '0', `width` smallint(6) unsigned not null default '0', `thumb` tinyint(1) unsigned not null default '0', `picid` mediumint(8) not null default '0', primary key (`aid`), key `tid` (`tid`), key `pid` (`pid`), key `uid` (`uid`)) engine=myisam default charset=utf8;

其它类似信息

推荐信息