SQL Óï¾äΪ±íÔö¼Ó,ÐÞ¸Ä,ɾ³ýÁÐ
1.ÐÞ¸ÄÁÐ
EXEC sp_rename 'TableName.ColumnName','NewColumName'
2.Ôö¼ÓÁÐ
ALTER TABLE TableName ADD ColumnName int --Type In Here
3.ɾ³ýÁÐ
ALTER TABLE TableName DROP Column ColumnName
Ïà¹ØÎĵµ£º
declare @XML XML
SET @XML='<root>
<OLDVALUE>
<H_Action id="1130">030</H_Action>
<D_Action>030</D_Action>
<OrderCompany>00220</OrderCompany>
<OrderNumber>10004035</OrderNumber> ......
ÔÚSQL Server2005ÖÐÓÐFOR XML Ó÷¨£¬¿ÉÒÔ½²Ò»¸ö±í×÷Ϊһ¸ö×ֶΡ£
ÎÒµÄÉè¼ÆÏë·¨Ö÷ÒªÊÇÓÃÔÚ1¶Ô¶àµÄ¹ØϵÖбí¶ÁÈ¡µÄÎÊÌâ¡£
±íA ±íB
ÔÚAÖÐÓÐÒ»Ìõ¼Ç¼¶øÔÚBÖÐÓжàÌõ¼Ç¼¿ÉÒÔ²ÎÕÕÏÂÃæµÄд·¨£º£¨ÎÒµÄÏîÄ¿ÖÐÓõ½µÄ£¬ÐÞ¸ÄÁË×Ö¶ÎÖ÷ÒªÊÇÑÝʾÓã©
select A.*,
(SELECT a, CAST(G_Univalence AS NVARCHAR(48)) AS G_Univa ......
¡¾SQL¡¿ÐÐÁÐת»»
http://space.itpub.net/519536/viewspace-609167
Ò»¡¢ÁбäÐÐ
1.´´½¨²âÊÔ±ítest£¬²¢³õʼ»¯ÊµÑéÊý¾Ý
sec@ora10g> create table test (name_id varchar2(10), name varchar2(10));
sec@ora10g> insert into test values ('01','Andy1');
sec@ora10g> insert into test values ('01','Andy2'); ......
ºÜÉÙÓÃjoin£¬Õâ´Îѧѧ£¬²¢±¸ÍüÁ½ÆªÎÄÕ£¡
ת×Ô£ºhttp://hcx-2008.javaeye.com/blog/285661
Á¬½Ó²éѯ
ͨ¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØϵÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌص㣬ҲÊÇËüÇø±ðÓÚÆäËüÀàÐÍÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£
ÔÚ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹Øϵ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚÒ ......