【正文】
oin。241。 外連接查詢中,可使用left join … on語法;外連接一律使用left join表示。241。 可以改寫為連接的子查詢禁止使用子查詢方式,而應(yīng)改寫為連接方式。示例241。 規(guī)范select col1, col2 from tbl1, tbl2 where = 。select col1, col2 from tbl1 left outer join tbl2 on = 。select col1, col2 from tbl1 left outer join tbl2 on = 。select col1 from tbl1,tbl2 where = 。select col1 from tbl1 left join tbl2 on = where is null。241。 非規(guī)范:select col1, col2 from tbl1 join tbl2 on = 。select col1 from tbl1 where col2 in (select col3 from tbl2)。select col1 from tbl1 where col2 not in (select col3 from tbl2)。. 分頁查詢說明241。 分頁查詢必須帶有唯一的排序條件,除非業(yè)務(wù)邏輯明確要求隨機(jī)展現(xiàn)數(shù)據(jù)。對(duì)于多表連接的分頁語句,如果過濾條件在單個(gè)表上,則先分頁,后連接。見示例241。 通過limit進(jìn)行分頁操作的時(shí)候,limit參數(shù)為start(起始記錄數(shù)),page_offset(每頁記錄數(shù))。示例241。 規(guī)范化用法:select , ,, from (select , from tbl1 t where = exporder by limit start, page_offerset) a,tbl2 bwhere = 。 應(yīng)用程序連接數(shù)據(jù)庫必須使用連接池。盡量不要使用memory引擎的表,除非能把握好對(duì)內(nèi)存表的控制。您好,歡迎您閱讀我的文章,本W(wǎng)ORD文檔可編輯修改,也可以直接打印。閱讀過后,希望您提出保貴的意見或建議。閱讀和學(xué)習(xí)是一種非常好的習(xí)慣,堅(jiān)持下去,讓我們共同進(jìn)步。