SQL Server ¼¸¸öºÃÓõÄSQLÓï¾ä
SQL Server ¼¸¸öºÃÓõÄSQLÓï¾ä
1¡¢¸´ÖƱí
select * into desttable from srctable
½« srctable ÍêÕûµØ¸´ÖÆÒ»·Ýµ½ desttable ÖУ¬µ±È»ºóÃæÒ²¿ÉÒÔ¼ÓÉÏÌõ¼þÀ´ÏÞ¶¨ÐèÒª¸´ÖƵļǼ
ÒªÇó£ºdesttable ±ØÐëΪ²»´æÔڵıíÃû¡£
insert into desttable(column1, column2) select columna, columnb from srctable
½« srctable ±íÖеÄcolumna, columnb ×Ö¶ÎÖƵ½ desttable µÄcolumn1, column2ÖУ¬ºóÃæÒ²¿ÉÒÔ¼ÓÉÏÌõ¼þÀ´ÏÞ¶¨ÐèÒª¸´ÖƵļǼ
ÒªÇó£ºdesttable ±ØÐëΪÒѾ´æÔڵıíÃû¡£
2¡¢Á¬½ÓÐ޸ġ¢É¾³ýÓï¾ä
delete from table1 from table1 inner join table2 on table1.id = table2.tid
±íµÄÁ¬½Óɾ³ýÓï¾ä
update table1 set table1.column1 = table2.columna, table1.column2 = table2.columnb
from table1 inner join table2 on table1.id = table2.id
±íµÄÁ¬½Ó¸üÐÂÓï¾ä£¬Ê¹ÓÃÆðÀ´·Ç³£·½±ã¡£
Ïà¹ØÎĵµ£º
ÕªÒª
¶ÔÓÚSQL ServerÖеÄÔ¼Êø£¬Ïë±Ø´ó¼Ò²¢²»ÊǺÜÄ°Éú¡£µ«ÊÇÔ¼ÊøÖÐÕæÕýµÄÄÚºÊÇʲô£¬²¢²»ÊǺܶàÈ˶¼ºÜÇå³þµÄ¡£±¾ÎÄÒÔÏêϸµÄÎÄ×ÖÀ´½éÉÜÁËʲôÊÇÔ¼Êø£¬ÒÔ¼°ÈçºÎÔÚÊý¾Ý¿â±à³ÌÖÐÓ¦ÓúÍʹÓÃÕâЩԼÊø£¬À´´ïµ½¸üºÃµÄ±à³ÌЧ¹û¡££¨±¾ÎIJ¿·ÖÄÚÈݲο¼ÁËSQL ServerÁª»úÊֲᣩ
ÄÚÈÝ
Êý¾ÝÍêÕûÐÔ·ÖÀà
ʵÌåÍêÕûÐÔ
&nb ......
Microsoft SQL Server ÏÖÔھ߱¸Óë Microsoft Windows .NET Framework µÄ¹«¹²ÓïÑÔÔËÐÐʱ (CLR) ×é¼þ¼¯³ÉµÄ¹¦ÄÜ¡£CLR ΪÍйܴúÂëÌṩ·þÎñ£¬ÀýÈç¿çÓïÑÔ¼¯³É¡¢´úÂë·ÃÎÊ°²È«ÐÔ¡¢¶ÔÏóÉú´æÆÚ¹ÜÀíÒÔ¼°µ÷ÊԺͷÖÎöÖ§³Ö¡£¶ÔÓÚ SQL Server Óû§ºÍÓ¦ÓóÌÐò¿ª·¢ÈËÔ±À´Ëµ£¬CLR ¼¯³ÉÒâζ×ÅÄúÏÖÔÚ¿ÉÒÔʹÓÃÈκ ......
. SQL ÃüÁî
Õⲿ·Ö°üº¬ÄÇЩ PostgreSQL Ö§³ÖµÄ SQL ÃüÁîµÄÐÅÏ¢£®ÕâÀïµÄ "SQL" ¾ÍÊǸÃÓïÑÔͨ³£µÄº¬Ò壻 ÿÌõÃüÁîµÄÓë±ê×¼ÓйصļæÈÝÐÔµÄÐÅÏ¢¿ÉÒÔÔÚÏà¹ØµÄ²Î¿¼Ò³ÖÐÕÒµ½£®
Table of Contents
ABORT -- Í˳öµ±Ç°ÊÂÎñ
ALTER GROUP -- Ïò×éÖÐÔö¼ÓÓû§»ò´Ó×éÖÐɾ³ýÓû§
ALTER USER -- ¸Ä±äÊý¾Ý¿â ......
½ñÌìÔÚÍøÉÏÉÏ¿´¼ûһƪ“½«SQL²éѯ½á¹ûת»¯Îªpojo¶ÔÏóµÄ”²©¿Í£¬²©Ö÷×Ô¶¨Òå×öÁËÒ»¸öÀàÈçÏ£º
import java.lang.reflect.Field;
import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.property.ChainedPropertyAccessor;&n ......
Èç¹ûtemp_t1²»´æÔÚ£¬
oracle:
create table temp_t1
as
select * from t1
sql server:
select * into temp_t1 from t1
Èç¹ûtemp_t1´æÔÚ£¬
oracle:
insert into table temp_t1
select * from t1
sql server:
insert into table temp_t1
select * from t1 ......