Îı¾µÄµ¼Èëµ¼³öºÍSQL½Å±¾µÄÖ´Ðз½·¨
Ò».Îı¾µ¼ÈëÊý¾Ý¿â
--²½Öè1.´´½¨¿ØÖÆÎļþ
load data¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ --1¡¢¿ØÖÆÎļþ±êʶ
infile 'E:\oradata\orcl\test\inf_user.txt'¡¡¡¡¡¡¡¡¡¡¡¡¡¡ --2¡¢ÒªÊäÈëµÄÊý¾ÝÎļþÃûΪinf_user.txt (Îļþȱʡ·Åµ½C:\ Ï£¬Èç¹û²»ÊÇ£¬¾ÍÐèÒªÖ¸Ã÷ȫ·¾¶)
append into table inf_user¡¡¡¡¡¡¡¡--3¡¢Ïò±ítestÖÐ×·¼Ó¼Ç¼
fields terminated by X'09'¡¡¡¡--4¡¢×Ö¶ÎÖÕÖ¹ÓÚX'09'£¬ÊÇÒ»¸öÖƱí·û£¨TAB£©
(mobile,id)¡¡¡¡ -----¶¨ÒåÁжÔӦ˳Ðò
--a¡¢insert£¬ÎªÈ±Ê¡·½Ê½£¬ÔÚÊý¾Ý×°ÔØ¿ªÊ¼Ê±ÒªÇó±íΪ¿Õ
--b¡¢append£¬ÔÚ±íÖÐ×·¼ÓмǼ
--c¡¢replace£¬É¾³ý¾É¼Ç¼£¬Ìæ»»³ÉÐÂ×°ÔصļǼ
--d¡¢truncate£¬Í¬ÉÏ
--²½Öè2.sqlldr
sqlldr user_test/user_test@orcl control=E:\oradata\orcl\test\input.ctl
¶þ.µ¼³öÎı¾£º
·½·¨1£º
SQL>spool d:\output.xls
SQL> set heading off; --½ûÖ¹Êä³öÁбêÌâ
SQL> set feedback off; --½ûÖ¹ÏÔʾ×îºóÒ»ÐеļÆÊý·´À¡ÐÅÏ¢
SQL> set pagesize 50000; --ÉèÖÃÏÔʾ¶àÉÙÐдòÓ¡Ò»´ÎÁÐÃû
SQL>select * from inf_user;
SQL>spool off
·½·¨2£º
developer-file-new-sql windows-ÓÒ¼ü²éѯ½á¹û-export results-tsv
Èý.Ö´ÐÐSQL½Å±¾
SQL> @c:aa.sql;
Ïà¹ØÎĵµ£º
Ê×ÏÈ£º·ÖÀëÊý¾Ý¿â
ÆóÒµ¹ÜÀíÆ÷--ÓÒ¼üsuspectµÄÊý¾Ý¿â--ËùÓÐÈÎÎñ--·ÖÀëÊý¾Ý¿âÈ»ºó±¸·ÝÄãµÄsuspectÊý¾Ý¿âµÄÎļþ,ÔÙ°´ÏÂÃæµÄ²½Öè´¦Àí:
1.н¨Ò»¸öͬÃûµÄÊý¾Ý¿â
2.ÔÙÍ£µôsql server
3.ÓÃsuspectÊý¾Ý¿âµÄÎļþ¸²¸ÇµôÕâ¸öн¨µÄͬÃûÊý¾Ý¿â
4.ÔÙÖØÆôsql server
5.´Ëʱ´ò¿ªÆóÒµ¹ÜÀíÆ÷ʱн¨µÄͬÃûÊý¾Ý¿â»á³öÏÖÖÃÒÉ£¬ÏȲ»¹Ü£¬Ö´ ......
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES ......
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¸ÄÉÆSQLÓï¾ä
¡¡¡¡ºÜ¶àÈ˲»ÖªµÀSQLÓï¾äÔÚSQL SERVERÖÐÊÇÈçºÎÖ´Ðеģ¬ËûÃǵ£ÐÄ×Ô¼ºËùдµÄSQLÓï¾ä»á±»SQL SERVERÎó½â¡£±ÈÈ磺
select * from table1 where name=''zhangsan'' and tID > 10000
ºÍÖ´ÐÐ:
select * from table1 where tID > 10000 and name=''zhangsan''
¡¡¡¡Ò»Ð©È˲»ÖªµÀ ......
--> Title : SQL Server 2005ÖеÄÎļþºÍÎļþ×é
--> Author : wufeng4552
--> Date : 2009-10-23
1¡¢ÎļþºÍÎļþ×éµÄº¬ÒåÓë¹Øϵ
ÿ¸öÊý¾Ý¿âÓÐÒ»¸öÖ÷Êý¾ÝÎļþ.ºÍÈô¸É¸ö´ÓÎļþ¡£ÎļþÊÇÊý¾Ý¿âµÄÎïÀíÌåÏÖ¡£ Îļþ×é¿ÉÒÔ°üÀ¨·Ö²¼ÔÚ¶à¸öÂß¼·ÖÇøµÄÎļþ£¬ÊµÏÖ¸ºÔØƽºâ¡£Îļþ×éÔÊÐ ......
SELECT CONVERT(varchar(100), CAST(@testFloat AS decimal(38,2)))
SELECT STR(@testFloat, 38, 2)
´ÓExcelÖе¼Èëµ½sql2000£¬ÓÐÒ»ÁГÁªÏµ·½Ê½”±ä³ÉÁËfloatÀàÐÍ£¬ÎÒÏëת»»³ÉnvarcharÀàÐÍ£¬ÓÃÏÂÃæµÄÓï¾ä
select convert(nvarchar(30),convert(int,ÁªÏµ·½Ê½)) from employee
go
//Êý¾ÝÒç³ö£¬²»ÐУ¡
select ......