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

oracle sqlÃæÊÔÌâ2

Ò»£®¼òµ¥SQL²éѯ£º
1£©:ͳ¼ÆÃ¿¸ö²¿ÃÅÔ±¹¤µÄÊýÄ¿
select dept,count(*) from employee group by dept;
2£©:ͳ¼ÆÃ¿¸ö²¿ÃÅÔ±¹¤µÄÊýÄ¿´óÓÚÒ»¸öµÄ¼Ç¼
select dept,count(*) from employee group by dept having count(*)>1;
3£©:ͳ¼Æ¹¤×ʳ¬¹ý1200µÄÔ±¹¤ËùÔÚ²¿ÃŵÄÃû³Æ
select e.first_name,salary,d.name
from s_emp e, s_dept d
where e.dept_id = d.id
and salary > 1200;
4£©:²éѯÄĸö²¿ÃÅûÓÐÔ±¹¤
select e.empno, d.deptno
from emp e, dept d
where e.deptno(+) = d.deptno
and e.deptno is null;
or
select *
from dept d
where not exists(select 1 from emp e
                            where e.deptno = d.deptno
                           );
¶þ£®¸´ÔÓSQL²éѯ
ÓÐ3¸ö±í£¨15·ÖÖÓ£©£º(SQL)
Student ѧÉú±í (ѧºÅ£¬ÐÕÃû£¬ÐÔ±ð£¬ÄêÁ䣬×éÖ¯²¿ÃÅ)
Course ¿Î³Ì±í (±àºÅ£¬¿Î³ÌÃû³Æ)
Sc Ñ¡¿Î±í (ѧºÅ£¬¿Î³Ì±àºÅ£¬³É¼¨)
±í½á¹¹ÈçÏ£º
 
1)    дһ¸öSQLÓï¾ä£¬²éѯѡÐÞÁË’JAVA’µÄѧÉúѧºÅºÍÐÕÃû£¨3·ÖÖÓ£©
´ð£ºSQLÓï¾äÈçÏ£º
select stu.sno, stu.sname
from student stu, course c, sc
where stu.sno = sc.sno
and sc.cno = c.cno
and c.cname=’JAVA’;
2)    дһ¸öSQLÓï¾ä£¬²éѯ’a’ͬѧѡÐÞÁ˵ĿγÌÃû×Ö£¨3·ÖÖÓ£©
´ð£ºSQLÓï¾äÈçÏ£º
select stu.sname, c.cname
from student stu, course c, sc
where stu.sno = sc.sno
and sc.cno = c.cno
and stu.sname = ’a’;
3)    дһ¸öSQLÓï¾ä£¬²éѯѡÐÞÁË5Ãſγ̵ÄѧÉúѧºÅºÍÐÕÃû£¨9·ÖÖÓ£©
´ð£ºSQLÓï¾äÈçÏ£º
select stu.sno, stu.sname
from student stu
where (select count(*) from sc where sno=stu.sno) = 5;
Èý. ÔÚSQLÖÐɾ³ýÖØ¸´¼Ç¼µÄ·½·¨:£¨Óõ½rowid (oracleαÁÐ)£©
1£©Í¨¹ý½¨Á¢ÁÙʱ±íÀ´ÊµÏÖ
SQL>create table temp_emp as (select distinct * from employee) 
SQL>truncate table employee; (Çå¿Õemployee±íµÄÊý¾Ý£©


Ïà¹ØÎĵµ£º

ʹÓÃmapviewµ¼shpÊý¾Ýµ½oracle spatial

MapViewer ÊÇÒ»¸ö J2EE ·þÎñ£¬ËüʹÓÃÓÉ Oracle Spatial ¹ÜÀíµÄ¿Õ¼äÊý¾ÝÀ´»æÖƵØÍ¼¡£MapViewer ÌṩµÄ·þÎñºÍ¹¤¾ßÒþ²ØÁ˿ռäÊý¾Ý²éѯºÍµØÍ¼²â»æµÄ¸´ÔÓÐÔ£¬Í¬Ê±Îª½Ï¸ß¼¶µÄÓû§Ìṩ¿ÉÒÔ×Ô¶¨ÒåµÄÑ¡Ïî¡£MapViewer Ö¼ÔÚÓë»ùÓÚλÖõķþÎñºÍÓ¦ÓóÌÐòÏ༯³É¡£
µ¥»÷´Ë´¦»ñµÃ Oracle Ó¦Ó÷þÎñÆ÷ MapViewer µÄÆÁÄ»ÕÕÆ¬¡£
http://www.or ......

redhat linux 5ÏÂoracle10.2°²×°×ܽá

ÔÚlinuxϰ²×°oracleÊǼþ·±ËöµÄÊÂÇé¡£¾ßÌåÀ´½²·ÖΪһϼ¸´ó²½£º
1.ÐÞ¸Äϵͳ°æ±¾
vi /etc/redhat-release
×¢Ê͵ôµÚÒ»ÐУ¬Ìí¼ÓÒ»ÐУºredhat-4
2.°²×°Èí¼þ°ü
rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh libaio-0*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh comp ......

SQL SERVERÖеÄÊý¾Ý¿â»Ö¸´¼¼Êõ


SQL ServerÊý¾Ý¿â±¸·ÝÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊÇʹÓÃBACKUP DATABASE½«Êý¾Ý¿âÎļþ±¸·Ý³öÈ¥£¬ÁíÍâÒ»ÖÖ¾ÍÊÇÖ±½Ó¿½±´Êý¾Ý¿âÎļþmdfºÍÈÕÖ¾ÎļþldfµÄ·½Ê½¡£ÏÂÃæ½«Ö÷ÒªÌÖÂÛһϺóÕߵı¸·ÝÓë»Ö¸´¡£±¾Îļٶ¨ÄúÄÜÊìÁ·Ê¹ÓÃSQL Server Enterprise Manager(SQL ServerÆóÒµ¹ÜÀíÆ÷)ºÍSQL Server Quwey Analyser(SQL Server²éѯ·ÖÎöÆ÷)
¡¡¡¡
¡ ......

SQL Serverµ¼³ö±íµ½EXCELÎļþµÄ´æ´¢¹ý³Ì


SQL Serverµ¼³ö±íµ½EXCELÎļþµÄ´æ´¢¹ý³Ì
 
·¢²¼Ê±¼ä£º2008.07.11 09:00     À´Ô´£ºÈüµÏÍø    ×÷ÕߣºÐ¡ÇÇ
¡¾ÈüµÏÍø£­IT¼¼Êõ±¨µÀ¡¿SQL Serverµ¼³ö±íµ½EXCELÎļþµÄ´æ´¢¹ý³Ì:
*--Êý¾Ýµ¼³öEXCEL
 
µ¼³ö±íÖеÄÊý¾Ýµ½Excel,°üº¬×Ö¶ÎÃû,ÎļþÎªÕæÕýµÄExcelÎļþ
,Èç¹ ......

Ò»¸ö×Ö¶ÎÆ¥ÅäµÄsqlÓï¾äÊéд

Õ⼸Ì츺ÔðÒ»¸ö¼Ò½ÌÃÅ»§ÍøÕ¾µÄ¿ª·¢£¬»ùÓÚcakephp¿ò¼Ü¡£ÔÚÅàѵ»ú¹¹±í£¨schools£©ÖдæÔÚÒ»¸ö×Ö¶ÎsubjectÓÃÀ´´æ´¢ÁíÒ»¸öÊý¾Ý±í
£¨subjects£©ÖмǼµÄidÖµ£¬ÇÒ´æ´¢ÐÎʽΪ£º'1,2,3,4,5'¡£µ«ÊÇÔÚÓ¦Óø߼¶ËÑË÷¹ýÂËÊ±Ò³ÃæselectÑ¡ÏîoptionµÄ´«ÖµÎª
subjectsµÄidÖµ£¬ÐèÒªÅжϲéѯ±íschoolsÖÐsubject×ֶδæÔÚ´Ëid£¬¼´²éѯÏÔʾ´Ë¼Ç¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ