SQL ѧϰ±Ê¼ÇÖ®Ë÷Òý
----use pubs-sales
-----´´½¨Ë÷Òý
create index index_name
on authors(au_lname)
--´´½¨Ë÷Òýºó±íÖÐËùÓеÄÊý¾Ý¸ú֮ǰûÓÐÇø±ð
select * from authors
--µ¥¶À²éË÷ÒýÁÐ
select au_lname from authors
--Ç¿ÖÆʹÓ÷Ǵؼ¯Ë÷Òý
select * from authors with(index(index_name))
--¶à×ֶηǴؼ¯Ë÷Òý
create index index_phoneaddress on authors(phone,address)
select * from authors with(index(index_phoneaddress))
---ʹÓÃclusterde´´½¨´Ø¼¯Ë÷Òý
--Ö÷¼üĬÈÏÊǴؼ¯Ë÷Òý£¬Ò»¸ö±íÖ»ÄÜÓÐÒ»¸ö´Ø¼¯Ë÷Òý£¬ËùÒÔÏÈÈ¥µôauidind
Drop index authors.UPKCL_auidind
create clustered index clusteredindex_name
on authors(au_lname)
--Ïú»ÙË÷Òý
drop index authors.index_name
drop index authors.clusteredindex_name
Ïà¹ØÎĵµ£º
×î½ü×öÏîÄ¿£¬ÐèÒªÔ¶³Ì·ÃÎÊÊý¾Ý¿â£¬×Ô¼ºÔÚ²éÁËЩ×ÊÁÏ£¬×ܽáÁËһϣ¬Ï£Íû¶Ô´ó¼ÒÓаïÖú£º
×÷Õߣºshinehoo
Ò»¡¢ÅäÖÃSQL Server 2005
1£©°²×°SQL Server 2005¿ª·¢°æ£»
2£©¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->SQL
Server 2005ÍâΧӦÓÃÅäÖÃÆ÷£¬ÔÚ´ò¿ªµÄ½çÃæµ¥»÷“·þÎñµÄÁ¬½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷”£¬ÔÚ´ò ......
ÄÚÈÝÕªÒª£ºÔÚPL/SQL¿ª·¢¹ý³ÌÖУ¬Ê¹ÓÃSQL£¬PL/SQL¿ÉÒÔʵÏִ󲿷ݵÄÐèÇ󣬵«ÊÇÔÚijЩÌØÊâµÄÇé¿öÏ£¬ÔÚPL/SQLÖÐʹÓñê×¼µÄSQLÓï¾ä»òDMLÓï¾ä²»ÄÜʵÏÖ×Ô¼ºµÄÐèÇ󣬱ÈÈçÐèÒª¶¯Ì¬½¨±í»òij¸ö²»È·¶¨µÄ²Ù×÷ÐèÒª¶¯Ì¬Ö´ÐС£Õâ¾ÍÐèҪʹÓö¯Ì¬SQLÀ´ÊµÏÖ¡£±¾ÎÄͨ¹ý¼¸¸öʵÀýÀ´ÏêϸµÄ½²½â¶¯Ì¬SQLµÄʹÓᣡ¡¡¡
¡¡¡¡±¾ÎÄÊÊÒ˶ÁÕß·¶Î§£ºOracle³ ......
declare @tablename varchar(20)
select @tablename = 'o_ems'
-------------Éú³É±äÁ¿,ʹÓñí¸ñÐÎʽ(ctrl + D)Êä³ö£¬È¡µÚÒ»¸ö×ֶεÄÖµ----------------------------------
select 'private '+
Case when t.name='varchar' Then 'string'
when t.name='char' Then 'string' &nb ......
1¡¢INSTR4(string1,string2[,a][,b]) ·µ»Østring1Öаüº¬string2µÄλÖÃaºÍbÊÇÒÔUCS4´úÂëµãΪµ¥Î»¡£
ÒÔÉϺ¯Êý·µ»Østring1Öаüº¬string2µÄλÖᣴÓ×ó±ß¿ªÊ¼É¨Ãèstring1,ÆðʼλÖÃÊÇA¡£Èç¹ûAΪ¸ºÊýÄÇô´ÓÓұ߿ªÊ¼É¨Ãè¡£µÚB´Î³öÏÖµÄλÖý«±»·µ»Ø¡£AºÍBȱʡ¶¼Îª1£¬¼´·µ»ØÔÚ
string1ÖеÚÒ»´Î³öÏÖstring2µÄλÖá£Èç¹ûstring2ÔÚAº ......
¡¡ÈçºÎÔ¶³ÌÅжÏ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.BYTE ......