Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sql

MSSQL ÐÐÊýͳ¼ÆµÄÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÓÐÁ½¸ö±í£¬ÊýÁ¿¼¶ÔÚ3000w×óÓÒ£¬
Ïë²é¿´¾ßÌåµÄÊýÁ¿£¬ÓÃselect Count(*) ËÙ¶ÈÌ«Âý£¬
֮ǰ¿´µ½ËµÔÚsysindexesÖÐÓÐrows ÁУ¬ µ«ÊÇÎÒ·¢ÏÖ£¬ÕâÁ½¸öµÄÖµ²»Ò»Ñù£¬Ôõô»ØÊ°¡£¿
лл
ÓÐÈËÄܻشðÒ»ÏÂÂð? ²»ÊǺÜÃ÷°×°¡

ÒýÓÃ
ÓÐÁ½¸ö±í£¬ÊýÁ¿¼¶ÔÚ3000w×óÓÒ£¬
Ïë²é¿´¾ßÌåµÄÊýÁ¿£¬ÓÃselect Count(*) ËÙ¶ÈÌ«Âý£¬
֮ǰ¿´µ½ËµÔÚsysi ......

sqlÓï¾äÇó½â - .NET¼¼Êõ / ASP.NET

Á½¸ö¶à±íÁª²é¶àÓï¾ä  
µÚÒ»¸ö±íÊÇ A BÁ½±í²é³ö
ID  
1
2
3
4
5
µÚ¶þ¸ö±íÉÌ A B CÈý±í²é³ö
3
4
5
ÎÊÈçºÎ°ÑʣϵÄ1£¬2Ò²²é³öÀ´
×îºÃÌù³öSQLÓï¾ä

union all ??
»òÕß×óÁ¬½Ó
SQL code:

select * from a left join b on a.id=b.id

°ï¶¥£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡

Éæ¼°Êý¾Ý¿â±íµÄÉè¼Æ£¬Ä ......

sqlÓï¾ä - MS-SQL Server / »ù´¡Àà

Ò»±í
ÐÕÃû | 1 | 2 | 3 | 4 | 5 |¡£¡£¡£¡£¡£¡£
ÕÅÈý ʼ٠²¡¼Ù ʼ٠²¡¼Ù ²¡¼Ù¡£¡£¡£¡£¡£
ÀîËÄ »é¼Ù ³ö²î ³ö²î ³ö²î ³ö²î
ÈçºÎµÃ³ö
ÐÕÃû ʼ٠²¡¼Ù »é¼Þ ³ö²î¡£¡£¡£¡£
ÕÅÈý 2 3 0 0
ÀîËÄ 0 0 1 4
¼ÙÈçÐкÍÁеÄÄÚÈݶ¼Êǹ̶¨µÄ£¬¿ ......

ÇóÒ»ÌõSQLÓï¾ä¡£ÈçÏ - .NET¼¼Êõ / C#

ÇóÒ»ÌõSQLÓï¾ä¡£ÈçÏÂ
±í a
id Ö÷¼ü
²¿ÃÅ id
Ô±¹¤ÐÕÃû
ѧÀú
±í b
id Ö÷¼ü
²¿ÃÅÃû
±í c
ѧÀú id
ѧÀúÃû
Çó±í
  ²¿ÃÅa ²¿ÃÅb ²¿ÃÅc ²¿ÃÅd
³õÖÐ x x x x 
¸ßÖÐ x x x x
´óר x x x x
´óѧ x x x x
ͳ¼Æ ÈËÊý
°ï¶¥~~

x x x x &n ......

SqlÓï¾ä - MS-SQL Server / ÒÉÄÑÎÊÌâ

дһ¸öSQlÓï¾äµÃµ½Ò»¸ö±íµÄ×îºóÒ»ÐеÄÖµ£¿
SQL code:
select top 1 * from tb order by id desc

Êý¾Ýû¹æÂÉ£¿1Â¥µÄÓï¾ä³ý·ÇÄãidÊÇ×ÔÔöÁС£·ñÔò²»ºÃ´¦Àí¡£

SQL code:
select top 1 * from tb order by id desc
Èç¹ûÓÐidµÄ»°¡£

Ó¦¸Ã°ÑÄãÕâ¸ö±íµÄÌØÕ÷˵³öÀ´£¬±ÈÈçÓÐʲô±È½ÏÌØÊâµÄ×ֶΡ£¡£±ÈÈç×ÔÔöÁеȡ£
Èç¹û ......

sqlÓï¾äÎÊÌâ - Oracle / »ù´¡ºÍ¹ÜÀí

id a b
-----------
1 2 12
1 1 100
1 2 123
1 1 130
1 2 153
1 1 171
1 1 188
1 2 200
1 2 222
1 1 234
1 2 333
1 2 344
1 2 411
ԭʼÊý¾Ý°´ÕÕbÁÐÅÅÐò£¬Õý³£Êý¾ÝaÁÐÊÇ1£¬2½»Ì棬Ȼºó·Ö±ðÈ¡µÃbÁеÄÖµ
Èç¹ûaÁпªÊ¼Êý¾Ý ......
×ܼǼÊý:3315; ×ÜÒ³Êý:553; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [10] [11] [12] [13] 14 [15] [16] [17] [18] [19]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ