頁面展示多表join的sql
create view v_qa_plaza_index_allquestion
as
select
g.gradename,
s.subjectname,
q.question_title,
P.NICKNAME,
T.BROWSE_COUNT,
q.question_status,
t.latest_update_time
from e_parentlogininfo p, e_subjectinfo s, q_questioninfo q, q_question_stat t, e_gradeinfo g
where Q.QUESTION_ID = P.LOGINID
and Q.SUBJECT_ID = S.SUBJECTID
and Q.STAGE_ID = G.GRADEID
and Q.QUESTIONID = T.QUESTIONID
union all
select
g.gradename,
s.subjectname,
q.question_title,
P.NICKNAME,
T.BROWSE_COUNT,
q.question_status,
t.latest_update_time
from e_logininfo p, e_subjectinfo s, q_questioninfo q, q_question_stat t, e_gradeinfo g
where Q.QUESTION_ID = P.LOGINID
and Q.SUBJECT_ID = S.SUBJECTID
and Q.STAGE_ID = G.GRADEID
and Q.QUESTIONID = T.QUESTIONID
union all
select
g.gradename,
s.subjectname,
q.question_title,
P.NICKNAME,
T.BROWSE_COUNT,
q.question_status,
t.latest_update_time
from e_teacherlogininfo p, e_subjectinfo s, q_questioninfo q, q_question_stat t, e_gradeinfo g
where Q.QUESTION_ID = P.LOGINID
and Q.SUBJECT_ID = S.SUBJECTID
and Q.STAGE_ID = G.GRADEID
and Q.QUESTIONID = T.QUESTIONID
as
select
g.gradename,
s.subjectname,
q.question_title,
P.NICKNAME,
T.BROWSE_COUNT,
q.question_status,
t.latest_update_time
from e_parentlogininfo p, e_subjectinfo s, q_questioninfo q, q_question_stat t, e_gradeinfo g
where Q.QUESTION_ID = P.LOGINID
and Q.SUBJECT_ID = S.SUBJECTID
and Q.STAGE_ID = G.GRADEID
and Q.QUESTIONID = T.QUESTIONID
union all
select
g.gradename,
s.subjectname,
q.question_title,
P.NICKNAME,
T.BROWSE_COUNT,
q.question_status,
t.latest_update_time
from e_logininfo p, e_subjectinfo s, q_questioninfo q, q_question_stat t, e_gradeinfo g
where Q.QUESTION_ID = P.LOGINID
and Q.SUBJECT_ID = S.SUBJECTID
and Q.STAGE_ID = G.GRADEID
and Q.QUESTIONID = T.QUESTIONID
union all
select
g.gradename,
s.subjectname,
q.question_title,
P.NICKNAME,
T.BROWSE_COUNT,
q.question_status,
t.latest_update_time
from e_teacherlogininfo p, e_subjectinfo s, q_questioninfo q, q_question_stat t, e_gradeinfo g
where Q.QUESTION_ID = P.LOGINID
and Q.SUBJECT_ID = S.SUBJECTID
and Q.STAGE_ID = G.GRADEID
and Q.QUESTIONID = T.QUESTIONID
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-667303/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- LEFT JOIN 和JOIN 多表連線
- js頁面展示省市聯動JS
- 用github來展示你的前端頁面吧Github前端
- 5.7(頁面展示紅星照耀中國)
- hadoop 多表join:Map side join及Reduce side join範例HadoopIDE
- github的gh-pages分支展示專案頁面Github
- 北大青鳥網站資訊展示頁面網站
- sql中的join、left join、right joinSQL
- MYSQL 怎麼 LEFT JOIN 多表聯查MySql
- 從輸入頁面地址到展示頁面資訊都發生了些什麼?
- 玩轉php環境日常更新---頁面展示PHP
- 多表連線的三種方式詳解 hash join、merge join、 nested loopOOP
- SQL joinSQL
- 通過swap_join_inputs來控制多表連線hash join中的build tableUI
- 專案實戰:彈出廣告任意頁面展示
- jenkins-APP打包頁面展示二維碼JenkinsAPP
- sql之left join、right join、inner join的區別SQL
- sql的left join 、right join 、inner join之間的區別SQL
- 解決Snackbar無法進行跨頁面展示的問題
- 資料庫實踐丨MySQL多表join分析資料庫MySql
- Oracle SQL JOINOracleSQL
- SQL -- JOIN子句SQL
- sql:left join和join區別SQL
- 【SQL】13 SQL 別名、SQL 連線(JOIN)、SQL INNER JOIN 關鍵字、SQL LEFT JOIN 關鍵字、SQL RIGHT JOIN 關鍵字、SQL FULL OUTER JSQL
- sql多表的關係介紹SQL
- 利用 GitHub 以及 Travis-CI 展示帶自己域名的 Vue 頁面GithubVue
- SQL語句中不同的連線JOIN及SQL中join的各種用法SQL
- mysql新建表和多表查詢,關鍵字joinMySql
- sql語句中JOIN ON 的使用SQL
- sql的 INNER JOIN 語法SQL
- 為什麼datawork 資料開發頁面展示不出來?
- Asp.Net MVC5 檢視頁面編譯呼叫流轉過程,以及頁面Web展示ASP.NETMVC編譯Web
- SQL not exist out joinSQL
- SQL Server Left joinSQLServer
- MySQL 多表查詢分頁MySql
- SQL中的Filter, join, semi-join等概念的釋義SQLFilter
- sql left join 和 right join解釋SQL
- Oracle總結【SQL細節、多表查詢、分組查詢、分頁】OracleSQL