求高手不惜賜教,問題是這樣的,做一個(gè)oracle分頁查詢,news_data是新聞表,news_type新聞?lì)愋?news_image是個(gè)新聞圖片表,一條新聞可能有多張圖片,要求只取一張圖片對(duì)應(yīng)一條新聞,然后分頁 現(xiàn)在情況是新聞?lì)愋投啵瑪?shù)據(jù)多 這樣查詢比較慢的,在線等
求高手不惜賜教,問題是這樣的,做一個(gè)oracle分頁查詢,news_data是新聞表,news_type新聞?lì)愋?news_image是個(gè)新聞圖片表,一條新聞可能有多張圖片,要求只取一張圖片對(duì)應(yīng)一條新聞,然后分頁 現(xiàn)在情況是新聞?lì)愋投啵瑪?shù)據(jù)多 這樣查詢比較慢的,在線等啊~~急急急 <無> $velocityCount-->select *from (select rownum rn,a.* from (select i.img_id,i.img_url,t.news_id,t.news_title,t.news_detail,t.news_date,t.match_type from news_data t left join (select x.img_id,x.news_id,x.img_url from news_image x where not exists(select 1 from news_image y where x.news_id = y.news_id and x.img_id > y.img_id)) i on t.news_id = i.news_id where t.news_type = 3 order by t.news_date desc) a where rownum <= 10 ) where rn > 0
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com