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

¾­µäSQL£¨2£©

1¡¢¾­µäµÄ²éѯÓï¾ä
2¡¢¾­µäµÄ×Ö¶¨Ò庯Êý
3¡¢¾­µäµÄÓëÒµÎñÏà¹ØµÄ´æ´¢¹ý³Ì
µÈµÈ
1¡¢ ¸ú×Ùµ±Ç°¶Ô»°ÏÂÓû§µÄSQL½Å±¾
select sql_text from v$sqltext_with_newlines where (hash_value,address)
in (select sql_hash_value,sql_address from v$session where sid=&sid)
order by address,piece;
SID
ÓÉÕâµÃµ½
select sid,machine from v$session;
======
desc table;¼ì²é±í½á¹¹
select * from tab where tabtype='TABLE';ÏÔʾµ±Ç°Óû§ÏµÄËùÓÐ±í¡£
select count(*) from table;ÏÔʾ´Ë±íµÄÊý¾ÝÐÐÊý£»
spool c:\tony.txt;ÈռǷ¾¶
spool off;¹Ø±Õ¼Ç¼ºó¿ÉÒÔ¿´µ½ÈÕ¼ÇÎļþÀïµÄÄÚÈÝ¡£
alter table stu add(classid number(2));Ìí¼Ó×Ö¶Î
alter table stu modify(xm varchar2(12));ÐÞ¸Ä×ֶεij¤¶È
alter table stu drop column sal;
drop table stu;
rename student to stu;
alter table student drop column sal; alter table stu add(salary number(7,2));
insert into stu values('A001','ÕÅÈý','ÄÐ','01-5ÔÂ-05',10);
insert into stu(xh,xm,sex) values ('A003','JOHN','Å®');
insert into student(xh,xm,sex,birthday) values ('A004','MARTIN','ÄÐ',null);
ÐÞ¸Ä
update
update stu set sex='Å®' where xh='A001';
update student set sex='ÄÐ'£¬birthday='1980-04-01'where xh='A001';
update student set classid=20 where birthday is null;
delete from stu;drop table student;delete from stu where xh='A001';
truncate table stu;ɾ³ý±íÖеÄËùÓмǼ£¬±í½á¹¹»¹ÔÚ²»Ð´ÈÕ¼ÇÎÞ·¨ÕһؼǼ
select * from stu;
select * from student where classid like '1%';
select * from student where xh like '%A%';
select * from student where xh like 'A%';
select * from student where xh like '%A';
select * from student where xh = 'A%';
select * from student order by birthday;
select * from student order by birthday desc,xh asc; --°´birthday ½µÐò °´xhÉýÐò(asc/ĬÈÏ)
select * from student where sex='Å®' or birthday='1999-02-01';
select * from student where sex='Å®' and birthday='1999-02-01';
select * from student where salary > 20 and xh <> 'B002'; (!=)
oracle
º¯ÊýµÄѧϰ
µ¥Ðк¯Êý  ·µ»ØÖµÖ»ÓÐÒ»¸ö
·Ö×é


Ïà¹ØÎĵµ£º

ABAP ͨ¹ýSQLÐÞ¸Äij¸ö³ÌÐòµÄËø¶¨×´Ì¬

ÏȰѳÌÐò´ò¿ª,²Ëµ¥ÉÏ Environment/Examples/Performance Examples ÔÚ¿Õ°×´¦ÊäÈë
ÒªÖ´ÐеijÌÐò,×¢ÒâÒ»¶¨ÒªÕýÈ·,·ñÔòºó¹ûºÜÑÏÖØ,ºÇºÇ.
data: itab type table of TRDIR with header line.
select  *  from TRDIR into table itab
where NAME = 'ZHRRPT1011'.
read table itab with key name = 'ZHRRPT1011'.
......

SQL Server 2000 Êý¾Ýͬ²½¹ý³Ì

SQL Server
2000¶©ÔÄÓë·¢²¼µÄ¾ßÌå²Ù×÷
ͬ²½¹ý³Ì
¡¡¡¡Ò»¡¢×¼±¸¹¤×÷£¬Èç¹ûÍê³ÉÔò¿ÉÌø¹ý¡£
¡¡¡¡1¡¢ÄÚÍøDB·þÎñÆ÷×÷Ϊ·¢²¼·þÎñÆ÷£¬ÍâÍøDB·þÎñÆ÷×÷Ϊ¶©ÔÄ·þÎñÆ÷¡£
¡¡¡¡·¢²¼·þÎñÆ÷ºÍ¶©ÔÄ·þÎñÆ÷ÉϷֱ𴴽¨WindowsÓû§jl,ÃÜÂëjl£¬Á¥ÊôÓÚadministrators£¬×¢ÒâÒª±£³ÖÒ»Ö¡£
¡¡¡¡2¡¢·¢²¼·þÎñÆ÷ÉÏ´´½¨Ò»¸ö¹²ÏíĿ¼£¬×÷Ϊ·¢²¼¿ìÕÕÎ ......

SQL Server 2005 µÄĬÈÏʵÀýºÍÃüÃûʵÀýµÄÎļþλÖÃ

SQL Server 2005 Áª»ú´ÔÊ飨2008 Äê 11 Ô£©
SQL Server 2005 µÄĬÈÏʵÀýºÍÃüÃûʵÀýµÄÎļþλÖÃ
¸üÐÂÈÕÆÚ£º 2005 Äê 12 Ô 5 ÈÕ
Microsoft SQL Server 2005 µÄ°²×°°üº¬Ò»¸ö»ò¶à¸öµ¥¶ÀµÄʵÀý¡£ÎÞÂÛÊÇĬÈϵϹÊÇÃüÃûµÄʵÀý£¬¶¼ÓÐ×Ô¼ºµÄÒ»Ì׳ÌÐòÎļþºÍÊý¾ÝÎļþ£¬ÒÔ¼°Ò»Ì×ÔÚ¼ÆËã»úÉϵÄËùÓÐʵÀýÖ®¼ä¹²ÏíµÄ¹«¹²Îļþ¡£
¶ÔÓÚ°üº ......

SQLÓÃDataDiff²éѯµÄ¹ÖÏÖÏó¶øÒý·¢µÄ˼¿¼(2)

ÔÚÄÔ×ÓÀïÀÏÊǼǵõ±³õдSQLµÄʱºò£¬×ÜÊÇÓÐÈËÌáÐѶÔÓÚÖ÷¼üµÄÌõ¼þҪдÔÚÇ°Ãæ£¬ÖÁÓÚΪʲôÏÖÔÚ×ÜÊǼDz»Çå³þÁË¡£µ«ÊÇSQLÖÐwhere Ìõ¼þµÄÖ´ÐÐ˳Ðò¸úÖ÷¼üÒÔ¼°Ë÷ÒýÓкܴóµÄ¹ØÏµ¡£
°ÑÉÏÆ¬Öеıía ¼ÓÉÏÖ÷¼ü£º
alter table
add constraint pk_a_id primary key (id)
È»ºóÔÚÔËÐÐÉÏÆªÖгö´íµÄÀý¾ä:
select * from a where id in (1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ