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

SQL²éѯÿËùѧУÓïÎijɼ¨×î¸ßµÄѧÉúÐÅÏ¢

Êý¾Ý¿â ÓÐÁ½Õűí
±í1£º student
±í2£ºchinese
ÏÖÔÚÒª·Ö±ðÁгö ÿËùѧУ ÓïÎijɼ¨×î¸ßµÄ ѧÉúÐÅÏ¢
SQL £º
SELECT *
from student
LEFT JOIN chinese ON student.no = chinese.no
WHERE chinese.chengji
IN (
SELECT max( chinese.chengji )
from student
LEFT JOIN chinese ON student.no = chinese.no
GROUP BY student.school
ORDER BY chinese.chengji DESC
)
LIMIT 0 ,30
Ö´Ðнá¹û£º
PS:  SQL Óï¾äÒ²ÊÇÔÚѧϰÖС£¿ÉÄÜдµÄÒ²²»ÊǺܺà ÌùÉÏÀ´·½±ãÏñÎÒÕâÑùµÄ²ËÄñ½è¼øһϠÈçÓиüºÃµÄ·½Ê½ Ï£Íû»Ø¸´¸æËßÎÒһϡ£±¾È˽«Íò·Ö¸Ð¼¤¡£


Ïà¹ØÎĵµ£º

SQL SERVER 2008 ±Ê¼ÇÖ®ÐÐѹËõºÍҳѹËõ

 
/*
    2008 ѹËõ
 
 
    ÐÐѹËõ
   
    SQL SERVER 2008 Òý½øÁËÐÐѹËõÕâ¸öÐÂÌØÐÔ,Ö»ÓÐÆóÒµ°æ¾ßÓиÃÐÂÌØÐÔ.ÐÐѹËõÖ»ÐèÒª×îµÍµÄ¿Õ¼ä¶ÔÐÐÊý¾Ý½øÐÐѹËõ.ÐÐѹËõ¿ÉÒÔÔÚCREATEÒ»¸ö±í,Ë÷Òý»òÕßALTERÒ»¸ö±í,Ë÷ÒýµÄʱºò½øÐд´½¨.ѹËõ¿ÉÒÔÔÚ ......

sqlÓï¾äѧϰ±Ê¼Ç(8) Ìí¼ÓÔ¼Êø£¬ÊµÏÖÊý¾ÝÍêÕûÐÔ

USE StudentInfo
--=====================================================
--Author     £ºyangjuncheng  
--Create Date:2010.5.26
--Decription :¸ø±íÌí¼ÓÔ¼Êø£¨¿ÉÒÔÔÚ´´½¨±íʾֱ½ÓÌí¼Ó
--            Ò²¿ÉÒÔʹÓÃalter¹Ø¼ ......

ÀûÓÃhibernateµÄQueryÖ±½ÓÖ´ÐÐSQLÓï¾ä

ÀûÓÃhibernateµÄQuery½øÐÐÖ±½ÓÖ´ÐÐSQLÓï¾ä
Ò»¡¢
String sql = "insert into SHOP_MALL_ACCOUNT_MAP_T (MALL_NO,ACCOUNT) values ('"
+ mallNo + "','" + userId + "')";
SQLQuery query = getSession().createSQLQuery(sql);
query.executeUpdate();
¶þ¡¢
String sql = "select to_char(SYN_DATE,' ......

SQL ServerÈçºÎ±¸·ÝÔ¶³ÌÊý¾Ý¿âµ½±¾µØ

     Èç¹ûûÓÐÔ¶³ÌÊý¾Ý¿âËùÔÚ·þÎñÆ÷µÄwindowsÕ˺ÅÃÜÂ룬½öÓÐÔ¶³ÌSQL ServerÊý¾Ý¿âµÄÓû§ÃÜÂ룬¸ÃÈçºÎ±¸·ÝÔ¶³ÌÊý¾Ý¿âdb1µÄÊý¾Ýµ½±¾µØÄØ£¿
1£ºÔÚ±¾µØ°²×°Í¨°æ±¾µÄÊý¾Ý¿âÈí¼þ£¨±ÈÈ磺SQL Server2000£©
2£ºÔÚ±¾µØÊý¾Ý¿â·þÎñÆ÷ÉÏ´´½¨Êý¾Ý¿âdb2£»
3£ºÊ¹Óñ¾µØ“ÆóÒµ¹ÜÀíÆ÷”×¢²áÔ¶³ÌÊý¾Ý¿â£¬²¢½ ......

sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð


sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð
left join(×óÁª½Ó) ·µ»Ø°üÀ¨×ó±íÖеÄËùÓмǼºÍÓÒ±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
right join(ÓÒÁª½Ó) ·µ»Ø°üÀ¨ÓÒ±íÖеÄËùÓмǼºÍ×ó±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
inner join(µÈÖµÁ¬½Ó) Ö»·µ»ØÁ½¸ö±íÖÐÁª½á×Ö¶ÎÏàµÈµÄÐÐ
¾ÙÀýÈçÏ£º
-------------------------------------------- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ