Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sql ·ÖÒ³Óï¾ä

1. select  top pageSize
* from table where id not in(select top((pageNo-1)*pageSize
) id from table order by id asc)
2. select * from table where  id<=pageSize*pageNo
and id>(pageNo-1)*pageSize
order by id asc
×¢£º
pagesizeÿҳÏÔʾµÄ¼Ç¼Êý
pageNoµ±Ç°µÚ¼¸Ò³


Ïà¹ØÎĵµ£º

SQL´æ´¢¹ý³ÌʵÀý


Àý1 ´«ÈëÒ»¸ö²ÎÊý@username,ÅжÏÓû§ÊÇ·ñ´æÔÚ
-------------------------------------------------------------------------------
CREATE PROC IsExistUser
(
@username varchar(20),
@IsExistTheUser varchar(25) OUTPUT--Êä³ö²ÎÊý
)
as
SELECT @IsExistTheUser = count(username)
from users
WHERE username ......

SQL´æ´¢¹ý³Ì

ʾÀý
A. ʹÓôøÓи´ÔÓ SELECT Óï¾äµÄ¼òµ¥¹ý³Ì
ÏÂÃæµÄ´æ´¢¹ý³Ì´ÓËĸö±íµÄÁª½ÓÖзµ»ØËùÓÐ×÷Õߣ¨ÌṩÁËÐÕÃû£©¡¢³ö°æµÄÊé¼®ÒÔ¼°³ö°æÉç¡£¸Ã´æ´¢¹ý³Ì²»Ê¹ÓÃÈκβÎÊý¡£
USE pubs
IF EXISTS (SELECT name from sysobjects
         WHERE name = 'au_info_all' AND type = 'P')
&nb ......

SQLÈÕÖ¾µÄ¸ÅÄî

½ñÌì³é³öÒ»µãʱ¼ä½âÊͼ¸¸ö¹ØÓÚSQLÈÕÖ¾µÄ¸ÅÄËûÃÇÒ²¾­³£Ê¹³õѧÕßÍû¶øÖ¹²½£¬·´Õý¼ÆËã»úµÄÊõÓﶼÊǺܳéÏóµÄ£¬ËùÒÔµÚÒ»¸Ð¾õ¾ÍÊÇÍ·ÌÛ£¬È»ºóÈ»ºó¼¸´Îºó¾Íû¸Ð¾õÁË.ÒÔÏÂÓÐЩÊÇ´ÓÊéÉÏÕª³­µÄ,ÓеÄÊÇ´ÓÍøÉÏÕÒµÄËãÊǽ軨Ï×·ð°É!!
¡¡¡¡ÎïÀíÈÕÖ¾Îļþ£º
    Õâ¸ö±È½ÏºÃÀí½â£¬ÊµÊµÔÚÔڵĶ«Î÷£¬Êý¾Ý¿âĿ¼ÏÂÃæµÄ.ldfÎļþ ......

Óû§saµÇ¼ʧ°Ü,¸ÃÓû§Óë¿ÉÐÅsql serverÁ¬½ÓÎÞ¹ØÁª

½ñÌì²âÊÔwebÏîĿн¨ÁËÒ»¸öÊý¾Ý¿â£¬½á¹û±¨´í,ÒÔÇ°µÇ¼ֱ½ÓÑ¡Ôñ'WindowsÉí·ÝÑéÖ¤',²¢Ã»ÓÐʲôÎÊÌâ³öÏÖ!¿ÉÇ°¶Îʱ¼ä²ÉÓÃ'SQLSERVERÉí·ÝÑéÖ¤'È¥µÇ¼,ËæÖ®µÄÎÊÌâ¾ÍÀ´ÁË.ÎÞÂÛÓÃʲô·½·¨¾ÍÊÇÒ»¸ö½á¹û³ö´í! ³ö´íµÄÔ­ÒòÊÇ:'Óû§ 'sa' µÇ¼ʧ°Ü¡£¸ÃÓû§Óë¿ÉÐÅ SQL Server Á¬½ÓÎÞ¹ØÁª'.½ñÌìÉÏÍøÉϲéÁË°ëÌ컹ÊǸ㲻¶¨,×îºó¾­¹ýÍøÉϺÍÊéÉ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ