sql Óï¾ä×ܽá
mysql : ½«Ò»¸ö±íµÄÊý¾Ý²åÈëµ½newT ÖÐ
£¨newT ±íÐë´æÔÚ£¬ÇҽṹÓëselect Óï¾ä¶ÔÓ¦µÄ½á¹¹Í¬ £¬×îºÃ²»ÓÃ* ¶øÊǾßÌå×ֶΣ©
insert into newT select * from t1 where ...
Ò²¿ÉÒÔcreate table newT select f1,f2 from t1; (select into µÄÌæ´ú·½·¨£¬mysql ²»Ö§³Öselect into )
MySQL²»Ö§³ÖSelect Into
database table µÄ±¸·Ý
mysqldump -uroot -proot -h192.101.111.111 databaseName [tableName] >a.sql
Éú³É±í½á¹¹¼°ÀïÃæµÄËùÓÐÊý¾Ý
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
¿ÉÒÔÓÃÏÂÁÐÓï¾ä
source a.sql ÖØÐµ¼Èë
µ±È»µ¼Èë֮ǰ¿ÉÒÔÐÞ¸Äa.sql ÀïµÄÄÚÈÝ£¬Èç±íÃû£¬Èç´Ë¿ÉʵÏÖ±¸·Ý
½«Êý¾Ý±¸·Ý£¬£¨²»Êǵ¼³ösql Óï¾ä£¬¶øÖ»µ¼³ö ÆäÖÐ µÄÊý¾Ý£©
select * into outfile 'c:\out.txt' from tableName where ...;
¶ÔÓ¦µÄµ¼È룺
load data local infile 'c:\out.txt' into table positiondata fileds terminated by ';' (userid ,username );
Ïà¹ØÎĵµ£º
ÏÈÀ´Ò»¶Î´úÂ룺
WITH OrderedOrders AS
(SELECT *,
ROW_NUMBER() OVER (order by [id])as RowNumber¡¡¡¡--idÊÇÓÃÀ´ÅÅÐòµÄÁÐ
from table_info ) --table_infoÊDZíÃû
SELECT *
from OrderedOrders
WHERE RowNumber between 50 and 60;
ÔÚwindows server 2003, sql server 2005 CTP,P4 2.66GHZ,1GB ÄÚ´æÏ²âÊÔ£¬Ö´ÐÐʱ ......
ÈçºÎÈ·¶¨ËùÔËÐÐµÄ SQL Server 2005 µÄ°æ±¾
Ҫȷ¶¨ËùÔËÐÐµÄ SQL Server 2005 µÄ°æ±¾£¬ÇëʹÓà SQL Server Management Studio Á¬½Óµ½ SQL Server 2005£¬È»ºóÔËÐÐÒÔÏ Transact-SQL Óï¾ä£º
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
ÔËÐнá¹ûÈçÏ£º
²úÆ·° ......
SQL ServerÓëExcelÊý¾Ý»¥µ¼
´ÓSQL ServerÖе¼Èë/µ¼³ö Excel µÄ»ù±¾·½·¨
/*=================== µ¼Èë/µ¼³ö Excel µÄ»ù±¾·½·¨ ===================*/
´ÓExcelÎļþÖÐ,µ¼ÈëÊý¾Ýµ½SQLÊý¾Ý¿âÖÐ,ºÜ¼òµ¥,Ö±½ÓÓÃÏÂÃæµÄÓï¾ä:
/*========================================================*/
--Èç¹û½ÓÊÜÊý¾Ýµ¼ÈëµÄ±íÒѾ´æÔÚ
ins ......
ÓαêµÄÀàÐÍ£º
1¡¢¾²Ì¬Óαê(²»¼ì²âÊý¾ÝÐеı仯£©
2¡¢¶¯Ì¬Óα꣨·´Ó³ËùÓÐÊý¾ÝÐеĸı䣩
3¡¢½öÏòǰÓα꣨²»Ö§³Ö¹ö¶¯£©
4¡¢¼ü¼¯Óα꣨ÄÜ·´Ó³Ð޸쬵«²»ÄÜ׼ȷ·´Ó³²åÈ롢ɾ³ý£©
ÓαêʹÓÃ˳Ðò£º
1¡¢¶¨ÒåÓαê
2¡¢´ò¿ªÓαê
3¡¢Ê¹ÓÃÓαê
  ......
½ñÌìÓöµ½Ò»¸ö¿Í»§£¬°Ñ×Ô¼ºÖ®Ç°¸éÖõÄÎÊÌâ°Úµ½ÁËÃæÇ°£¬´ëÊÖ²»¼°Ï´¦ÀíÆðÀ´×ßÁ˲»ÉÙÍä·£¬×îÖÕҲûÓÐÍêÈ«½â¾ö£¬Ö÷Òª»¹ÊǼ¼Êõ´¢±¸²»¹»¡£ÆäÖÐÓйØEXCLEÊý¾Ýµ¼ÈëSQL2000ʱÓöµ½Á½¸öÎÊÌ⣬ÔÚÍøÉÏËÑË÷Á˽â¾ö°ì·¨£¬ÊÕ²ØÒ»Ï£º
1¡¢½«Excelµ¼Èëµ½SQL severÊý¾Ý¿â£¬Ìáʾ˵“Íⲿ±í²»ÊÇÔ¤ÆÚµÄ¸ñʽ”
&nbs ......