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

SQL²éѯÓï¾ä

SQL code:

--û½á¹û
select stu.sno,stu.sname from student stu
where (select count(*) from sc sc inner join student stu on sc.sno=stu.sno) =5

--Óнá¹û
select stu.sno, stu.sname from student stu
where (select count(*) from sc where sno=stu.sno) = 5



ÊÇʲôԭÒò?ÁíÍâÓÐûÓв»ÓÃ×Ó²éѯµÄ°ì·¨ÄØ?
--û½á¹û
select stu.sno,stu.sname from student stu
where (select count(*) from sc sc inner join student stu on sc.sno=stu.sno) =5

--Óнá¹û
--Õâ¸ö¿ÉÒÔÏÈÕâÑùÀí½âÒ»ÏÂ,ÉÏÃæµÄÒ²Ò»ÑùµÄÀí½â,Ó¦¸ÃÃ÷°×ÁË
select stu.sno, stu.sname,(select count(*) from sc where sno=stu.sno)
from student stu
where
(select count(*) from sc where sno=stu.sno) = 5


SQL code:

select stu.sno, stu.sname from student stu
where sno IN
(select sno from sc GROUP BY sno HAVING COUNT(1)= 5)


select count(*) from sc sc inner join student stu on sc.sno=stu.sno
ÕâÊÇͳ¼ÆÓÐÑ¡¿ÎµÄÈËÊý£¬Èç¹ûÑ¡¿Î×Ü´ÎÊý²»ÊÇ5£¬¾ÍÏ൱ÓÚ²éѯÌõ¼þ·ñ¶¨£¬½á¹ûµ±È»Îª0

µÚ¶þ¸öÊDzÉÓùØÁª²éѯ£¬²ÅÄܲéѯѡÐÞ5ßöµÄÈË

select count(*) from sc sc inner join student stu on sc.sno=stu.sno

ÕâÊÇÒ»¸öÈ·¶¨µÄֵѽ

select stu.sno,stu.sname from student stu
where


Ïà¹ØÎÊ´ð£º

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

Asp+sql serverÎÊÌâ - Web ¿ª·¢ / ASP

ÎÒÒ»¸öÏîÄ¿£¬Óиö²åÈë²Ù×÷£¬¾ßÌåÊÇÕâÑùµÄ£º
ÎÒÓнø»õÐÅÏ¢±í¡£ÔÚ³ö»õʱѡÔñÏàÓ¦µÄ½ø»õÐÅÏ¢£¬ÊäÈëÊýÁ¿£¬Ñ¡Ôñ²¿Ãź󣬵㱣´æ°´Å¥£¬ÓÉÓÚÍøÂçÑÓʱ£¬µãÒ»ÏÂûÓз´Ó³£¬ÓÚÊÇÓû§¾ÍÓÖµãһϣ¬µ¼ÖÂÒ»´Î²åÈëÁËÁ½Ìõ¼Ç¼:
Àý£º ......

sqlÓÅ»¯ - Oracle / »ù´¡ºÍ¹ÜÀí

select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' 
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......

ÈçºÎʹÓÃMySQL - MS-SQL Server / »ù´¡Àà

¸Õ¸Õ½Ó´¥MySQL,²»ÖªµÀ¸ÃÈçºÎÈ¥²é¿´Êý¾Ý£¬²åÈëÊý¾Ý£¬´´½¨Êý¾Ý¿â¡¢±í£¬ÓÃÄÄΪǰ±²ÄÜÖ¸½ÌÒ»¶þ£¿

MySQL 5.1²Î¿¼ÊÖ²á

ÒýÓÃ
ÐÖµÜÄã»á½áÌùÂð£¿
mysql ²Î¿¼ÊÖ²á

baidu

MySQL¹Ù·½Îĵµ http://dev.mysql.com/doc ......

Á½¾äSQL²¢Ò»¾ä,ÓÐÎÊÌâ. - MS-SQL Server / »ù´¡Àà

µÚÒ»¾ä:
select ht.gfdm,gfdm.gfmc,gfdm.lb ,sum(jh.htdj*jh.htsl)as je
from ht left join gfdm on ht.gfdm=gfdm.gfdm 
 join jh on ht.htbh=jh.hth 
and ht.htbh not like'del%' and ht. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ