ʵÓÃSQL語¾ä
http://blog.csdn.net/fenglibing/archive/2007/10/24/1841537.aspx
1¡¢½«Ò»¸ö±íÖеÄÄÚÈÝ¿½±´µ½ÁíÍâÒ»¸ö±íÖÐ
insert into testT1(a1,b1,c1) select a,b,c from test;
insert into testT select * from test; (Ç°ÌáÊÇ兩個±íµÄ結構ÍêÈ«Ïàͬ)
insert into notebook(id,title,content)
select notebook_sequence.NEXTVAL,first_name,last_name from students;
×¢:a1,b1,c1ÊÇ現ÔÚ±íÖеÄ×Ö¶ÎÃû¡£A,b,cÊÇÔ±íÖеÄ×Ö¶ÎÃû
¿½±´µ¥ÌõÊý¾Ý
insert into a (select '123' as id, temp,temp2 from b where id=10)
2¡¢²éÕÒÖظ´¼Ç¼
SELECT DRAWING,DSNO from EM5_PIPE_PREFAB
WHERE ROWID!=(SELECT MAX(ROWID) from EM5
_PIPE_PREFAB D
WHERE EM5_PIPE_PREFAB.DRAWING=D.DRAWING AND
EM5_PIPE_PREFAB.DSNO=D.DSNO);
3¡¢É¾³ýÖظ´¼Ç¼
DELETE from EM5_PIPE_PREFAB
WHERE ROWID!=(SELECT MAX(ROWID) from EM5
_PIPE_PREFAB D
WHERE EM5_PIPE_PREFAB.DRAWING=D.DRAWING AND
EM5_PIPE_PREFAB.DSNO=D.DSNO);
4¡¢復ÖƱí結構
ÔÚORACLEÖÐ: create table new_table as select * from old_table where rownum < 1;
ÔÚSQL SERVERÖÐ:˵Ã÷£º¸´ÖƱí(Ö»¸´Öƽṹ,Ô´±íÃû£ºa бíÃû£ºb)
¡¡¡¡SQL: select * into b from a where 1<>1 ¡¡
Óï¾ä
5¡¢Ò»´Î刪³ý¶à個×Ö¶Î
alter table TEST_A drop (TEST_num,test_name);
6¡¢實現Ò»個±íµÄ備·Ý
create table tableName_bak as select * from tableName;
7¡¢創½¨兩個±íµÄÖ÷Íâ鍵關聯
--ÏÈ創½¨Ö÷±í
create table t1(id int,stu_name varchar(50));
--為Ö÷±íÔö¼Ó³Ö¾ÃµÄÖ÷鍵約Êø
alter table t1 add(constraint t1_id primary key(id) deferrable);
--創½¨從±í£¬²¢將從±íµÄid設為Ö÷鍵
create table t2(id int primary key,sex varchar(10),address varchar(50));
--為從±íÔö¼ÓÍâ鍵約Êø£¬該約Êø來×ÔÓÚÖ÷±íËù創½¨µÄ約Êø×Ö¶Î
--當從Ö÷±íÖÐ刪³ý記錄時£¬×Ô動刪³ý從±íÖÐ與Ö®Ïà對µÄ¾ßÓÐÏàͬidµÄ記錄
--Ĭ
Ïà¹ØÎĵµ£º
ÒýÓÃ:http://blog.csdn.net/wizardlun/archive/2009/09/08/4531576.aspx
½ñÌ죬ÖÕÓÚ°ÑoracleÖеÄÊý¾Ý¿âµ¼Èëµ½sql serverÖÐÁË£¬·½·¨ÈçÏ£º
Ò»¡¢ÔÚsql serverÖн¨¸öͬÃûÊý¾Ý¿â£¬ÀýÈçssdb¡£
¶þ¡¢ÓÒ¼üµã»÷ssdb,Ñ¡Ôñ“ËùÓÐÈÎÎñ”——>“µ¼ÈëÊý¾Ý”£¬¾Í»áµ¯³öÒ»¸ö“DTS ......
use AdventureWorks
GO
SELECT c.LastName from Person.Contact c;
SELECT * from HumanResources.Employee e
INNER JOIN HumanResources.Employee m
ON e.ManagerID = m.EmployeeID; n
SELECT ProductID,Name,ProductNumber,ReorderPoint
from Production.Product
where ProductID in( select ProductID fro ......
phpmyadmin ÐÞ¸ÄÖ´ÐÐsqlÎļþ´óСÏÞÖÆ
´ò¿ªphp.ini
post_max_size = 100M ; ±íµ¥Ìá½»Îļþ´óСÉÏÏÞ
memory_limit = 128M ; ÄÚ´æÉÏÏÞ
upload_max_filesize = 100M ; ÉÏ´«Îļþ´óСÉÏÏÞ
ÐÞ¸ÄÒÔÉÏÈýÏ¾Í¿ÉÒÔ½â¾ö¡£ µ«ÊÇ´ËʱPHPMYADMINÖÐ×î´óÏÞÖÆ£º22,528 KB£¬ ......
Microsoft SQL Server ÏÖÔھ߱¸Óë Microsoft Windows .NET Framework µÄ¹«¹²ÓïÑÔÔËÐÐʱ (CLR) ×é¼þ¼¯³ÉµÄ¹¦ÄÜ¡£CLR ΪÍйܴúÂëÌṩ·þÎñ£¬ÀýÈç¿çÓïÑÔ¼¯³É¡¢´úÂë·ÃÎÊ°²È«ÐÔ¡¢¶ÔÏóÉú´æÆÚ¹ÜÀíÒÔ¼°µ÷ÊԺͷÖÎöÖ§³Ö¡£¶ÔÓÚ SQL Server Óû§ºÍÓ¦ÓóÌÐò¿ª·¢ÈËÔ±À´Ëµ£¬CLR ¼¯³ÉÒâζ×ÅÄúÏÖÔÚ¿ÉÒÔʹÓÃÈκ ......