SQL·ÖÒ³²éѯ
thunder:
1.MYSQLʵÏÖ
mysql> select * from user;
+----+----------+----------+-----------------+
| ID | username | password | email |
+----+----------+----------+-----------------+
| 1 | admin | admin | abc@yahoo.cn |
| 2 | thomas | 159753 | thomas@yahoo.cn |
| 3 | thomas1 | 159753 | thomas@yahoo.cn |
| 4 | huhu | 159753 | hu@yahoo.cn |
| 5 | fdg | dfg | fdg |
| 6 | sdf | sd | sdf@yahoo.cn |
| 7 | d | d | d@d.cn |
+----+----------+----------+-----------------+
7 rows in set (0.00 sec)
mysql> select * from user limit 3,2;
+----+----------+----------+-------------+
| ID | username | password | email |
+----+----------+----------+-------------+
| 4 | huhu | 159753 | hu@yahoo.cn |
| 5 | fdg | dfg | fdg |
+----+----------+----------+-------------+
2 rows in set (0.00 sec)
mysql>
===================================================
2.MSSQLServerʵÏÖ
select top 5 function_id,function_name from d_function
where function_id not in (select top 5 function_id from d_function)
6 ÔÂͳ¼Æ
7 ²¿ÃŲéѯ
8 ¹«Ë¾²éѯ
9 ¹¤³ÌÕбê
10 ¹¤³Ì×ܽá
Ïà¹ØÎĵµ£º
1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......
Èç¹ûÄã¾³£Óöµ½ÏÂÃæµÄÎÊÌ⣬Äã¾ÍÒª¿¼ÂÇʹÓÃSQL ServerµÄÄ£°åÀ´Ð´¹æ·¶µÄSQLÓï¾äÁË£º
SQL³õѧÕß¡£
¾³£Íü¼Ç³£ÓõÄDML»òÊÇDDL SQL Óï¾ä¡£
ÔÚ¶àÈË¿ª·¢Î¬»¤µÄSQLÖУ¬Ã¿¸öÈ˶¼ÓÐ×Ô¼ºµÄSQLÏ°¹ß£¬Ã»ÓÐÒ»Ì×ͳһµÄ¹æ·¶¡£
ÔÚSQL Server Management StudioÖУ¬ÒѾ¸ø´ó¼ÒÌṩÁ˺ܶೣÓõÄÏÖ³ÉSQL¹æ·¶Ä£°å¡£
SQL Server Management ......
·½·¨Ò»¡¢¾¡Á¿Ê¹Óø´ÔÓµÄSQLÀ´´úÌæ¼òµ¥µÄÒ»¶Ñ SQL.
ͬÑùµÄÊÂÎñ£¬Ò»¸ö¸´ÔÓµÄSQLÍê³ÉµÄЧÂʸßÓÚÒ»¶Ñ¼òµ¥SQLÍê³ÉµÄЧÂÊ¡£Óжà¸ö²éѯʱ£¬ÒªÉÆÓÚʹÓÃJOIN¡£
oRs=oConn.Execute("SELECT * from Books")
while not oRs.Eof
strSQL = "SELECT * from Authors WHERE AuthorID="&oRs("AuthorID") oRs2=oConn.Execute(strSQ ......
--MyDBΪÐÞ¸´µÄÊý¾ÝÃû
USE MASTER
GO
SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE
GO
ALTER DATABASE MyDB SET EMERGENCY
GO
sp_dboption 'MyDB', 'single user', 'true'
GO
DBCC CHECKDB('MyDB','REPAIR_ALLOW_DATA_LOSS')
GO
ALTER DATABASE MyDB SET ONLINE
GO
sp_configure 'allow updates ......
ÕýÈ·µÄÐ޸ķ½·¨£ºsqlÅúÁ¿ÐÞ¸Ä×Ö¶ÎÄÚÈݵÄÓï¾ä
1¡¢Ã»ÊÔ¹ý£¬ÍøÉÏËÑË÷µÄ
ÒýÓÃ
update '±íÃû' set ÒªÐÞ¸Ä×Ö¶ÎÃû = replace (ÒªÐÞ¸Ä×Ö¶ÎÃû,'±»Ìæ»»µÄÌض¨×Ö·û','Ìæ»»³ÉµÄ×Ö·û')
2¡¢×Ô¼º°´ÕÕÒ»¸öÒ»¸öÐÞ¸ÄÊÇ¿´Êý¾Ý±í×ܽáµÄ
ÀýÈçżÐÞ¸Ä×Ô¼º²©¿Íboblog_replies±íÖеÄadminrepidºÍadminreplier×Ö¶ÎÖµ£º
UPDATE `xxx`.`boblog_ ......