ÇóSqlÓï¾äÒ»Ìõ - MS-SQL Server / »ù´¡Àà
Ò»¸ö±í a £¬×öÁËÒ»¸öa ±íµÄ ±¸·Ý È¡Ãû a_bak£¨×ֶζ¼ÊÇÏàͬµÄ£©¡£
ÏÖÔÚ ²»Ð¡ÐÄ°Ñ a ±íijһÌõ¼Ç¼¸øɾ³ýÁË£¬µ«ÊÇ Ò²²åÈë a_bak±íÖУ¬
ÏÖÔÚ ÈçºÎ°Ñ a_bak ±íÖÐÄÇÒ»Ìõ¼Ç¼ ÔÙ²åÈë a±íÖÐ....???
ÓÉÓÚa±íÖÐ µÄ×ֶηdz£µÄ¶à£¬
insert Ä¿±ê±íÃû£¨×Ö¶ÎÁÐ±í£© select ×Ö¶ÎÁбí from Ô´±íÃû where ¿½±´Ìõ¼þ
×Ö¶ÎÁÐ±í ¾ÍҪд °ÑËùÓÐ×ֶζ¼Ð´½øÈ¥£¬
Õâ¸ö ·½·¨ ¾ÍÏԵñȽϸ´ÔÓ£¬ºÜÂé·³...
»¹ÓÐû ¸üºÃµÄ·½·¨£¿£¿£¿
¾ÍÓÃinsert into °É
²»ÓÃдÌõ¼þ insert a select * from a_bak where Ìõ¼þ
SQL code:
insert into b (id)
select id from a_back
ûÓиüºÃµÄ°ì·¨£¬²»¾Í²ÅÒ»Ìõ¼Ç¼Âð£¬Âé·³Ò²¾ÍÊÇÒ»´Î¡£
×îºÃµÄ·½·¨ÊÇ°ÑÄãÕýʽ±íɾ³ý£¬°Ñ±¸·Ý±íÈ«²¿¿½±´Ò»ÏÂÔÙ¸´ÖÆÒ»·Ý¾ÍÐУ¬´úÂ붼²»ÓÃд¡£
insert into
ÓÃÕâ¾äÏÔʾ³öËùÓеÄ×Ö¶ÎÃû
SQL code:
select name from syscolumns where id = object_id('a')
ÔÙ±à¼Ò»Ï¾ͿÉÒÔÓÃÁË
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
ÓÐÕâÑùÒ»ÌõSQL
Select Get_Costtaxrate(col1), Get_Tcostvalue(col1) from a
ÆäÖÐGet_Costtaxrate¡¢Get_Tcostvalue¶¼ÊǺ¯Êý£¬ÕâÁ½¸öº¯ÊýÀïÃ涼ÊDzéÕÒÒ»¸ö´ó±í£¬Get_Tcostvalue»¹ÐèÒªµ÷ÓÃGet_C ......
ÏÖÔÚÓÐÒ»¸ö²¿Ãűídept£¨²¿ÃÅÃû³Æ£¬²¿Ãźš£¡££©ÓÐÒ»¸öÈËÔ±±íemp£¨ÐÕÃû£¬ÈËÔ±±àºÅ£¬Ö°Î»£¬Ð½×Ê£¬²¿ÃÅ£©
emp±íÖеÄÄÚÈÝÊÇÕâÑùµÄ£º
a 1 ¹¤³Ìʦ 3000 Èí¼þ²¿
b 2 ÆÕͨԱ¹¤ 2000 Ó²¼þ²¿
c 3 ¹¤³Ìʦ 4000 Ó²¼þ²¿
d ......