乙個操作裡面選有兩個函式體:第乙個先在熱點表裡進行選擇,選擇了幾個給出幾個;然後不足45個後面的再根據瀏覽量選擇
public listselectrecommendcompositionlist()
rs.close();
ps.close();
} catch (sqlexception e)
int count = compositionlist.size();
int leftcount = 45 - count;
sql = "select uucaid, title, compositiontype, compositeid, imageurl, counter, datetime " +
"from composition_details " +
"where compositiontype != 3 and valid=1 anduucaid not in (select uucaid from mannual_pops)" +
"order by counter desc " +
"limit 0, ?";
try
rs.close();
ps.close();
} catch (sqlexception e)
return compositionlist;
}
Redis資料庫 列表操作
1.lpush key value 在列表頭部插入元素,返回值是新增後列表的長度。2.lrange key start stop 檢視列表中指定範圍的元素。3.rpush key value 在列表的尾部插入元素,返回值是新增元素後列表的長度。4.lpop key 從頭部彈出乙個元素,返回值是刪除的...
資料庫書籍推薦
oracle dba實戰攻略 內容介紹 oracle dba實戰攻略 運維管理 診斷優化 高可用與最佳實踐 是目前oracle資料庫運維領域不可多得的一本著作,也是為數不多的既有大量實踐應用案例又包含實戰方 的 資料庫學習 著作。作者根據其多年的運維診斷經驗,從資料庫如何建立開始,循序漸進地介紹了資...
redis資料庫常用雙向列表操作
list列表 雙向鍊錶結構 redis列表是簡單的字串列表,按照插入順序排序。你可以新增乙個元素到列表的頭部 左邊 或者尾部 右邊 list即可以作為 棧 也可以作為 佇列 操作 lpush list1 world 在list1頭部壓入乙個字串 lpush list1 hello 在list1頭部壓...