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

sql server ÅÅÐò

ÔÚsql Server ´Ó¿ª·¢»·¾³ÍùÉú²ú»·¾³²¿Êðʱ£¬ÒòΪ¿Í»§ÄÇÀïÓõÄÊÇÓ¢ÎÄ°æ±¾£¬ËùÒÔ´´½¨Êý¾Ý¿âÒÔºó£¬ÒªÉèÖÃÒ»ÏÂÊý¾Ý¿âÅÅÐò¹æÔò¡£
µ«ÊÇÔÚ´æ´¢¹ý³ÌÖУ¬ÓеijÌÐòԱʹÓÃÁËÁÙʱ±í£¬ÒòΪÁÙʱ±íÊÇ´æ´¢ÔÚϵͳÊý¾Ý¿âtempdbÖУ¬Èç¹ûϵͳÁÙʱÊý¾Ý¿âûÓнøÐÐÅÅÐò¹æÔòµÄÉèÖ㬳ÌÐò»¹Êdzö´í£¬½â¾ö°ì·¨¾ÍÊÇÉèÖÃÁÙʱÊý¾Ý¿âµÄÅÅÐò¹æÔò»òÕß´´½¨ÁÙʱ±íʱ£¬¶Ô×Ö·ûÀàÐ͵ÄÁÐÖ¸¶¨ÅÅÐò¹æÔò¡£


Ïà¹ØÎĵµ£º

SQL³£Ó÷ÖÒ³µÄ°ì·¨ תÔØ

±íÖÐÖ÷¼ü±ØÐëΪ±êʶÁУ¬[ID] int IDENTITY (1,1)
1.·ÖÒ³·½°¸Ò»£º(ÀûÓÃNot InºÍSELECT TOP·ÖÒ³)
Óï¾äÐÎʽ£º
SELECT TOP Ò³¼Ç¼ÊýÁ¿ *
from ±íÃû
WHERE (ID NOT IN
(SELECT TOP (ÿҳÐÐÊý*(Ò³Êý-1)) ID
from ±íÃû
ORDER BY ID))
ORDER BY ID
//×Ô¼º»¹¿ÉÒÔ¼ÓÉÏһЩ²éѯÌõ¼þ
Àý:
select top 2 ......

ORACLE SQLÓÅ»¯ ORACLEÖ´Ðмƻ®

Last login: Mon Feb  8 14:13:19 2010 from 192.168.1.249
ipnet
-bash-3.00$
-bash-3.00$ ipnet
-bash: ipnet: command not found
-bash-3.00$ su - oracle
Password:
eastcsu: incorrect password
-bash-3.00$ eastcom
-bash: eastcom: command not found
-bash-3.00$ su - oracle
Password:
[oracl ......

¸ß¼¶SQL 2

1 ÓÃUNIONÌæ»»OR (ÊÊÓÃÓÚË÷ÒýÁÐ)
ͨ³£Çé¿öÏÂ, ÓÃUNIONÌæ»»WHERE×Ó¾äÖеÄOR½«»áÆ𵽽ϺõÄЧ¹û. ¶ÔË÷ÒýÁÐʹÓÃOR½«Ôì³ÉÈ«±íɨÃè. ×¢Òâ, ÒÔÉϹæÔòÖ»Õë¶Ô¶à¸öË÷ÒýÁÐÓÐЧ.
Èç¹ûÓÐcolumnûÓб»Ë÷Òý, ²éѯЧÂÊ¿ÉÄÜ»áÒòΪÄãûÓÐÑ¡ÔñOR¶ø½µµÍ. ÔÚÏÂÃæµÄÀý×ÓÖÐ, LOC_ID ºÍREGIONÉ϶¼½¨ÓÐË÷Òý.
¸ßЧ: SELECT LOC_ID , LOC_DESC , ......

SQLÖÐÖ÷¼üºÍÍâ¼üµÄÇø±ð

Ö÷¼ü:
Äܹ»Î¨Ò»±íʾÊý¾Ý±íÖеÄÿ¸ö¼Ç¼µÄ¡¾×ֶΡ¿»òÕß¡¾×ֶΡ¿µÄ×éºÏ¾Í³ÆΪÖ÷Âë(Ö÷¼ü)¡£ Ò»¸öÖ÷¼üÊÇΨһʶ±ðÒ»¸ö±íµÄÿһ¼Ç¼£¬µ«ÕâÖ»ÊÇÆä×÷ÓõÄÒ»²¿·Ö£¬Ö÷¼üµÄÖ÷Òª×÷ÓÃÊǽ«¼Ç¼ºÍ´æ·ÅÔÚÆäËû±íÖеÄÊý¾Ý½øÐйØÁª¡£ÔÚÕâÒ»µãÉÏ£¬Ö÷¼üÊDz»Í¬±íÖи÷¼Ç¼֮¼äµÄ¼òµ¥Ö¸Õë¡£Ö÷¼üÔ¼Êø¾ÍÊÇÈ·¶¨±íÖеÄÿһÌõ¼Ç¼¡£Ö÷¼ü²»ÄÜÊÇ¿ÕÖµ¡£Î¨Ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ