oracle ±Ê¼Ç VII Ö® ´óÊý¾ÝÁ¿ÏµķÖÒ³
ÔÚORACLE ´óÊý¾ÝÁ¿ÏµķÖÒ³½â¾ö·½·¨¡£Ò»°ãÓýØÈ¡ID ·½·¨£¬»¹ÓÐÊÇÈý²ã ǶÌ×·½·¨
Ò»ÖÖ·ÖÒ³·½·¨
<%
int i = 1;
int numPages = 14;
String pages = request.getParameter("page");
int currentPage = 1;
currentPage = (pages == null)?1:Integer.parseInt(pages);
sql = "select count(*) from tables";
ResultSet rs = DBLink.executeQuery(sql);
µÚ36Ò³ ¹² 59 Ò³
while(rs.next())
i = rs.getInt(1);
int PageCount = 1;
PageCount = (i%numPage == 0) ?(i/numPages):(i/numPages+1);
int nextPage;
int up Page;
nextPage = currentPage + 1;
if(nextPage > = PageCount)
nextPage = PageCount;
upPage = currentPage - 1;
if(upPage <=1)
upPage = 1;
rs.close();
sql="select * from tables";
rs = DBLink.executeQuery(sql);
i = 0;
while((i<numPages*(currentPage-1)) && rs.next())
{ i++;}
//Êä³öÄÚÈÝ
//Êä³ö·Ò³Á¬½Ó
ºÏ¼Æ£º<%=currentPage%>/<%=intPageCount%>Ò³
<a href="List.jsp?page=1">µÚÒ»Ò³</a>
<a href="List.jsp?page=<%=upPage%>">ÉÏÒ»Ò³</a>
<%
for(int j=1;j<PageCount;j++){
if(currentPage != j)
&
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
2009-11-15 13:06:35
½ñÌìÔÚITPUB·¢ÏÖһƪÎÄÕ£¬ÀÏÔçÒÔǰµÄÁË£¬Ð´µÄÂùÓÐÒâ˼£¬ÌØÒâת¹ýÀ´Êղء£
¶ÔÓÚ Oracle µÄ rownum ÎÊÌ⣬ºÜ¶à×ÊÁ϶¼Ëµ²»Ö§³Ö>,>=,=,between...and£¬Ö»ÄÜÓÃÒÔÉÏ·ûºÅ(<¡¢<=¡¢!=)£¬²¢·Ç˵ÓÃ>, >=,=,between..and ʱ»áÌáʾSQLÓï·¨´íÎ󣬶øÊǾ³£ÊDz鲻³öÒ»Ìõ¼Ç¼À´£¬»¹»á³öÏÖËÆº ......
½ñÌìÔÚ¹äÂÛ̳µÄʱºò¿´µ½shiyiwanͬѧдÁËÒ»¸öºÜ¼òµ¥µÄÓï¾ä£¬¿ÉÊÇorder byºóÃæµÄÐÎʽȴ±È½ÏÐÂÓ±£¨¶ÔÓÚÎÒÀ´ËµÅ¶£©£¬ÒÔǰ´ÓÀ´Ã»¿´¹ýÕâÖÖÓ÷¨£¬¾ÍÏë¼ÇÏÂÀ´£¬ÕýºÃ×ܽáÒ»ÏÂORDER BYµÄ֪ʶ¡£
1¡¢ORDER BY ÖйØÓÚNULLµÄ´¦Àí
ȱʡ´¦Àí£¬OracleÔÚOrder by ʱÈÏΪnullÊÇ×î´óÖµ£¬ËùÒÔÈç¹ûÊÇASCÉýÐòÔòÅÅÔÚ×îºó£¬DESC½µÐòÔòÅÅÔÚ×îǰ¡£
......
Êý¾Ý×ÖµäÊÇOracle´æ·ÅÓйØÊý¾Ý¿âÐÅÏ¢µÄµØ·½£¬ÆäÓÃ;ÊÇÓÃÀ´ÃèÊöÊý¾ÝµÄ¡£±ÈÈçÒ»¸ö±íµÄ´´½¨ÕßÐÅÏ¢£¬´´½¨Ê±¼äÐÅÏ¢£¬ËùÊô±í¿Õ¼äÐÅÏ¢£¬Óû§·ÃÎÊȨÏÞÐÅÏ¢µÈ¡£µ±Óû§ÔÚ¶ÔÊý¾Ý¿âÖеÄÊý¾Ý½øÐвÙ×÷ʱÓöµ½À§ÄѾͿÉÒÔ·ÃÎÊÊý¾Ý×ÖµäÀ´²é¿´ÏêϸµÄÐÅÏ¢¡£
OracleÖеÄÊý¾Ý×ÖµäÓо²Ì¬ºÍ¶¯Ì¬Ö®·Ö¡£¾²Ì¬Êý¾Ý×ÖµäÖ÷ÒªÊÇÔÚÓû§·ÃÎÊÊý¾Ý×Öµäʱ²»»á·¢ ......
2.¸ù¾ÝOracle Êý¾Ý¿âscott ģʽϵÄemp ±íºÍdept ±í£¬Íê³ÉÏÂÁвÙ×÷£º
(1) ²éѯ20ºÅ²¿ÃŵÄËùÓÐÔ±¹¤ÐÅÏ¢£»
(2) ²éѯËùÓй¤ÖÖΪCLERK µÄÔ±¹¤µÄÔ±¹¤ºÅ¡¢Ô±¹¤ÃûºÍ²¿Ãźţ»
(3) ²éѯ½±½ðCOMM ¸ßÓÚ¹¤×ÊSAL µÄÔ±¹¤ÐÅÏ¢£»
  ......