¹ØÓÚ·ÖÒ³µÄsqlÓï¾ä
¶ÔÓÚÓÐÖ÷¼ü×Ô¶¯Ôö³¤Êý¾Ý¿â±í£¬ÔÚ½øÐзÖÒ³ÉèÖÃʱ£¬ÎÒÈÏΪ»¹±È½Ï²»´íµÄÊÇ£º
SELECT TOP Ò³´óС *
from TestTable
WHERE (ID >
(SELECT MAX(id)
from (SELECT TOP Ò³´óС*Ò³Êý id
from ±í
ORDER BY id) AS T))
ORDER BY ID
Ïà¹ØÎĵµ£º
select upper(name) from syscolumns
where id =any
(
select Id from sysobjects where name='tb_city'
)
lower
select row_number() over(order by firmid) from dbo.tb_BuildingMaterial
Éú³É ×ÔÔö 123
select rank() over(order by firmid) from dbo.tb_BuildingMaterial
Éú³É×ÔÔö123 ¸ù¾ÝÅ ......
2008Êý¾Ý¿â¸½¼Ó
/*
ÍøÉÏ¿´µ½µÄÕûÀíÁËһϡ£
ÔÎĵØÖ·http://database.51cto.com/art/201003/190984.htm
ÔÚSQL Server 7.0ÖУ¬Î¢ÈíÍƳöÁËsp_attach_dbºÍsp_attach_single_file_dbϵͳ´æ´¢¹ý³Ì¡£
Ëü¶ÔÓÚSQL ServerÊý¾Ý¿â¹ÜÀíÔ±Ö´ÐÐÏÂÃæµÄÈÎÎñÊǷdz£·½±ãµÄ£º
1 ʹÓÃsp_attach_d ......
1.×Ö·û´®º¯Êý
³¤¶ÈÓë·ÖÎöÓÃ
datalength(Char_expr) ·µ»Ø×Ö·û´®°üº¬×Ö·ûÊý,µ«²»°üº¬ºóÃæµÄ¿Õ¸ñ
substring(expression,start,length) ²»¶à˵ÁË,È¡×Ó´®
right(char_expr,int_expr) ·µ»Ø×Ö·û´®ÓÒ±ßint_expr¸ö×Ö·û
×Ö·û²Ù×÷Àà
upper(char_expr) תΪ´óÐ ......
´íÎó´¦Àí
ÔÚSQL Server2000ÖгöÏֵĴíÎó¾ßÓÐÒÔϼ¸¸öÌص㣺
´íÎóºÅ£ºÃ¿¸ö´íÎó״̬¶¼¶ÔӦΨһµÄ´íÎóºÅ¡£
´íÎóÐÅÏ¢×Ö·û´®£º´íÎóÐÅÏ¢ÌṩÁËÓйشíÎóÔÒòµÄÕï¶ÏÐÅÏ¢¡£Ðí¶à´íÎóÐÅÏ¢¶¼ÓÐÌæ»»±äÁ¿£¬ÆäÖаüº¬Ò»Ð©ÐÅÏ¢£¬Èç²úÉú´íÎóµÄ¶ÔÏóÃû³Æ¡£Ã¿¸ö´íÎóºÅ¶¼¶ÔӦΨһµÄ´íÎóÐÅÏ¢¡£
ÑÏÖضȣºÑÏÖضȱíʾ´íÎóµÄÑÏÖس̶ȡ£ ......