首頁 後端開發 php教程 求一条sql话语。

求一条sql话语。

Jun 13, 2016 am 10:35 AM
default NOT null

求一条sql语句。。
想了半天,也没个头绪不知道该怎么写。
我要查询DISCUZ X2.0的三个表,分别是pre_forum_thread,pre_forum_attachment索引表,pre_forum_attachment_n的子表

SQL code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->CREATE 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 code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->CREATE 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 code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->CREATE 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;<div class="clear">
                 
              
              
        
            </div>
登入後複製
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
1 個月前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

c語言中null和NULL的差別是什麼 c語言中null和NULL的差別是什麼 Sep 22, 2023 am 11:48 AM

c語言中null和NULL的差異是:null是C語言中的一個宏定義,通常用來表示一個空指針,可以用來初始化指針變量,或是在條件語句中判斷指針是否為空;NULL是C語言中的一個預先定義常數,通常用來表示一個空值,用來表示一個空的指標、空的指標數組或是空的結構體指標。

undefined和null是什麼意思 undefined和null是什麼意思 Nov 20, 2023 pm 02:39 PM

在JavaScript 中,undefined和null都代表著「無」的概念:1、undefined 表示一個未初始化的變數或一個不存在的屬性,當宣告了一個變數但沒有對其賦值時,這個變數的值就是undefined ,當存取物件中不存在的屬性時,傳回的值也是undefined;2、null表示一個空的物件引用,在某些情況下,可以將物件的引用設為null,以便釋放其佔用的記憶體。

什麼時候用null和undefined 什麼時候用null和undefined Nov 13, 2023 pm 02:11 PM

null和undefined都表示缺少值或未定義的狀態,根據使用場景的不同,選擇使用null或undefined有以下一些指導原則:1、當需要明確指示一個變數為空或無效時,可以使用null;2、當一個變數已經宣告但尚未賦值時,會被預設為undefined;3、當需要檢查一個變數是否為空或未定義時,使用嚴格相等運算子「===」來判斷變數是否為null或undefined 。

null和undefined有什麼不同 null和undefined有什麼不同 Nov 08, 2023 pm 04:43 PM

null和undefined的差異在:1、語意意義;2、使用場景;3、與其它值的比較;4、與全域變數的關係;5、與函數參數的關係;6、可空性檢定;7、性能考慮;8、在JSON序列化中的表現;9、與類型的關係。詳細介紹:1、語意意義,null通常表示知道這個變數不會擁有任何有效的物件值,而undefined則通常表示變數未被賦值,或物件沒有此屬性;2、使用場景等等。

配置default gateway 配置default gateway Dec 07, 2023 pm 03:02 PM

設定default gateway的步驟:1、開啟控制面板;2、選擇網路和Internet;3、設定網路連線;4、設定IP位址;5、設定DNS伺服器位址;6、確認設定;7、重新啟動網路設備。詳細介紹:1、開啟控制台,在Windows系統中,點選開始選單,選擇「控制台」;2、選擇網路和Internet,在控制台中,選擇「網路和Internet」;3、設定網路連線等等。

default gateway怎麼配置 default gateway怎麼配置 Dec 07, 2023 am 11:34 AM

設定default gateway的步驟:1、確定路由器的IP位址;2、開啟電腦的網路設定介面;3、設定網路連線;4、設定IPv4設定;5、輸入IP位址與子網路遮罩;6、設定預設閘道;7、配置DNS伺服器;8、儲存設定。詳細介紹:1、確定路由器的IP位址,預設閘道的位址通常是路由器的IP位址,在路由器的背面或使用手冊中,可以找到路由器的IP位址;2、開啟電腦的網路設定等等。

java中null的用法有哪些 java中null的用法有哪些 Mar 01, 2024 am 10:10 AM

用法:1、將引用類型的變數初始化為null,表示該變數目前不指向任何物件;2、將引用類型的變數設為null,可以釋放該變數所引用的物件的記憶體空間,幫助垃圾回收器回收該物件;3、使用null來檢查一個引用是否為空,可以透過判斷引用是否為null來避免NullPointerException異常的發生;4、在條件判斷中使用null,可以判斷某個引用是否為空。

怎麼配置default gateway 怎麼配置default gateway Dec 07, 2023 pm 02:56 PM

設定default gateway的步驟:1、了解網路環境;2、取得路由器IP位址;3、登入路由器管理介面;4、找到並設定WAN埠設定;5、設定預設閘道;6、儲存設定並登出;7、檢查網路連線是否正常。設定default gateway是網路設定中的重要步驟,它決定了主機透過哪個路由器存取網際網路。

See all articles