Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL ALTER TABLE Óï¾ä

³ö´¦£ºhttp://www.w3school.com.cn/sql/sql_alter.asp ALTER TABLE Óï¾ä ALTER TABLE Óï¾äÓÃÓÚÔÚÒÑÓеıíÖÐÌí¼Ó¡¢Ð޸Ļòɾ³ýÁС£ SQL ALTER TABLE Óï·¨ ÈçÐèÔÚ±íÖÐÌí¼ÓÁУ¬ÇëʹÓÃÏÂÁÐÓï·¨: ALTER TABLE table_name
ADD column_name datatype
Ҫɾ³ý±íÖеÄÁУ¬ÇëʹÓÃÏÂÁÐÓï·¨£º
ALTER TABLE table_name
DROP COLUMN column_name
×¢ÊÍ£ºÄ³Ð©Êý¾Ý¿âϵͳ²»ÔÊÐíÕâÖÖÔÚÊý¾Ý¿â±íÖÐɾ³ýÁеķ½Ê½ (DROP COLUMN column_name)¡£
Òª¸Ä±ä±íÖÐÁеÄÊý¾ÝÀàÐÍ£¬ÇëʹÓÃÏÂÁÐÓï·¨£º
ALTER TABLE table_name
ALTER COLUMN column_name datatype
ԭʼµÄ±í (ÓÃÔÚÀý×ÓÖеÄ)£º
Persons ±í:
Id

LastName

FirstName

Address

City
1

Adams

John

Oxford Street

London
2

Bush

George

Fifth Avenue

New York
3

Carter

Thomas

Changan Street

Beijing
SQL ALTER TABLE ʵÀý
ÏÖÔÚ£¬ÎÒÃÇÏ£ÍûÔÚ±í "Persons" ÖÐÌí¼ÓÒ»¸öÃûΪ "Birthday" µÄÐÂÁС£
ÎÒÃÇʹÓÃÏÂÁÐ SQL Óï¾ä£º
ALTER TABLE Persons
ADD Birthday date
Çë×¢Ò⣬ÐÂÁÐ "Birthday" µÄÀàÐÍÊÇ date£¬¿ÉÒÔ´æ·ÅÈÕÆÚ¡£Êý¾ÝÀàÐ͹涨ÁÐÖпÉÒÔ´æ·ÅµÄÊý¾ÝµÄÀàÐÍ¡£
Ð嵀 "Persons" ±íÀàËÆÕâÑù£º
Id

LastName

FirstName

Address

City

Birthday
1

Adams

John

Oxford Street

London
2

Bush

George

Fifth Avenue

New York
3

Carter

Thomas

Changan Street

Beijing
¸Ä±äÊý¾ÝÀàÐÍʵÀý
ÏÖÔÚÎÒÃÇÏ£Íû¸Ä±ä "Persons" ±íÖÐ "Birthday" ÁеÄÊý¾ÝÀàÐÍ¡£
ÎÒÃÇʹÓÃÏÂÁÐ SQL Óï¾ä£º
ALTER TABLE Persons
ALTER COLUMN Birthday year
Çë×¢Ò⣬"Birthday" ÁеÄÊý¾ÝÀàÐÍÊÇ year£¬¿ÉÒÔ´æ·Å 2 λ»ò 4 λ¸ñʽµÄÄê·Ý¡£
DROP COLUMN ʵÀý
½ÓÏÂÀ´£¬ÎÒÃÇɾ³ý "Person" ±íÖÐµÄ "Birthday" ÁУº
ALTER TABLE Person
DROP COLUMN Birthday
Persons ±í»á³ÉΪÕâÑù:
Id

LastName

FirstName

Address

City
1

Adams

John

Oxford Street

London
2

Bush

George

Fifth Avenue

New York
3

Carter

Thomas

Changan Street

Beijing


Ïà¹ØÎĵµ£º

SQL³£Óú¯Êý¼¯½õ 1

Ò»¡¢×Ö·ûת»»º¯Êý
1¡¢ASCII()
·µ»Ø×Ö·û±í´ïʽ×î×ó¶Ë×Ö·ûµÄASCII ÂëÖµ¡£ÔÚASCII£¨£©º¯ÊýÖУ¬´¿Êý×ÖµÄ×Ö·û´®¿É²»ÓÑ’À¨ÆðÀ´£¬µ«º¬ÆäËü×Ö·ûµÄ×Ö·û´®±ØÐëÓÑ’À¨ÆðÀ´Ê¹Ó㬷ñÔò»á³ö´í¡£
2¡¢CHAR()
½«ASCII Âëת»»Îª×Ö·û¡£Èç¹ûûÓÐÊäÈë0 ~ 255 Ö®¼äµÄASCII ÂëÖµ£¬CHAR£¨£© ·µ»ØNULL ¡£
3¡¢LOWER()ºÍ ......

ORACLEÊý¾Ý¿âÀï±íµ¼ÈëSQL ServerÊý¾Ý¿â

ORACLEÊý¾Ý¿âÀï±íµ¼ÈëSQL ServerÊý¾Ý¿â
   
  1¡¢ÔÚÄ¿µÄSQL ServerÊý¾Ý¿â·þÎñÆ÷ÉÏ°²×°ORACLE ClientÈí¼þ»òÕßORACLE ODBC Driver.
    ÔÚ$ORACLE_HOME\network\admin\tnsnames.oraÀïÅäÖÃORACLEÊý¾Ý¿âµÄ±ðÃû(service name)¡£
   
  2¡¢ÔÚWIN2000»òÕßwin200 ......

SQL Server2005 SynonymµÄʹÓÃ

--> Title  : SQL Server2005 SynonymµÄʹÓÃ
--> Author : wufeng4552
--> Date   : 2009-10-30
1.SynonymµÄ¸ÅÄî
¡¡  Synonym£¨Í¬Òå´Ê£©ÊÇSQL Server 2005µÄÐÂÌØÐÔ¡£¿ÉÒÔ¼òµ¥µÄÀí½âSynonymΪÆäËû對ÏóµÄ±ðÃû¡£
語·¨
CREATE SYNONYM [ schema_name_1. ] synonym_name FOR & ......

SQL ServerÖлã×ܹ¦ÄܵÄʹÓÃGROUPING,ROLLUPºÍCUBE

1.Óà CUBE »ã×ÜÊý¾Ý
 CUBE ÔËËã·ûÉú³ÉµÄ½á¹û¼¯ÊǶàάÊý¾Ý¼¯¡£¶àάÊý¾Ý¼¯ÊÇÊÂʵÊý¾ÝµÄÀ©Õ¹£¬ÊÂʵÊý¾Ý¼´¼Ç¼¸ö±ðʼþµÄÊý¾Ý¡£À©Õ¹½¨Á¢ÔÚÓû§´òËã·ÖÎöµÄÁÐÉÏ¡£ÕâЩÁб»³ÆΪά¡£¶àάÊý¾Ý¼¯ÊÇÒ»¸ö½á¹û¼¯£¬ÆäÖаüº¬Á˸÷ά¶ÈµÄËùÓпÉÄÜ×éºÏµÄ½»²æ±í¸ñ¡£ CUBE ÔËËã·ûÔÚ SELECT Óï¾äµÄ GROUP BY ×Ó¾äÖÐÖ¸¶¨¡£¸ÃÓï¾äµÄÑ¡ÔñÁбíÓ ......

sql serverÒ»¸öʹÓÃÓαêµÄʵÀý

--´´½¨Óαê
DECLARE Cursor1 CURSOR FOR
SELECT NODE_NO,NODE_VALUE,SUM(RESALE_SUM-RESALERETU_SUM+SALE_SUM-SALERETU_SUM) sale_sum,
SUM(STORE_SUM) sum_store,SUM(STORE_SUM) store_sum,
sum(RESALE_PROFIT-RESALERETU_PROFIT+SALE_PROFIT-SALERETU_PROFIT-ADJUST_PROFIT) sale_profit
from ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ