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

¡¾×ª¡¿ sqlͳ¼Æ£­¹ØÓÚѧÉú³É¼¨(´ð°¸)

sqlͳ¼Æ£­¹ØÓÚѧÉú³É¼¨(´ð°¸)
http://blog.sina.com.cn/s/blog_61380b320100ej9p.html
´ð°¸£º
1.       ¼ÆËãÿ¸öÈ˵Ä×ܳɼ¨²¢ÅÅÃû
select name,sum(score) as allscore from stuscore group by name order by allscore
2.   ¼ÆËãÿ¸öÈ˵Ä×ܳɼ¨²¢ÅÅÃû
select distinct t1.name,t1.stuid,t2.allscore from  stuscore t1,
(
    select stuid,sum(score) as allscore from stuscore group by stuid
)t2
where t1.stuid=t2.stuid
order by t2.allscore desc
3. ¼ÆËãÿ¸öÈ˵¥¿ÆµÄ×î¸ß³É¼¨
 select t1.stuid,t1.name,t1.subject,t1.score from stuscore t1,
(
select stuid,max(score) as maxscore from stuscore group by stuid
) t2
where t1.stuid=t2.stuid and t1.score=t2.maxscore
4.¼ÆËãÿ¸öÈËµÄÆ½¾ù³É¼¨
select distinct t1.stuid,t1.name,t2.avgscore from stuscore t1,
(
select stuid,avg(score) as avgscore from stuscore group by stuid
) t2
where t1.stuid=t2.stuid
5.Áгö¸÷Ãſγ̳ɼ¨×îºÃµÄѧÉú
select  t1.stuid,t1.name,t1.subject,t2.maxscore from stuscore t1,
(
select subject,max(score) as maxscore from stuscore group by subject
) t2
where t1.subject=t2.subject and t1.score=t2.maxscore
6.Áгö¸÷Ãſγ̳ɼ¨×îºÃµÄÁ½Î»Ñ§Éú
select distinct t1.* from stuscore t1 
where t1.stuid in 
(select top 2 stuscore.stuid from stuscore where subject = t1.subject order by score desc) 
order by t1.subject
 
7.ѧºÅ    ÐÕÃû    ÓïÎÄ     Êýѧ     Ó¢Óï     ×Ü·Ö  Æ½¾ù·Ö
select&nbs


Ïà¹ØÎĵµ£º

ADO.NETºÍSQL SERVERÊý¾Ý¿âÖеÄÊý¾ÝÀàÐͶÔÓ¦¹ØÏµ

ÎÒÃÇÖªµÀ£¬ÔÚSQL SERVERÖÐÓÐBit, Float, Int , CharµÈµÈһϵÁеÄÊý¾ÝÀàÐÍ£¬¶øÔÚDOT NETÖУ¬ÓÐBoolean,Double,Int 32,StringµÈÊý¾ÝÀàÐÍÓëÖ®¶ÔÓ¦¡£ Ò²¾ÍÊÇ˵£¬Êý¾Ý¿âÖеÄÊý¾ÝÀàÐÍÓëDOT NETµÄÊý¾ÝÀàÐÍÖ®¼ä£¬ÓÐÒ»¸öÓ³Éä¹ØÏµ¡£Ï±íÊÇËûÃǵÄÓ³Éä¹ØÏµ£º
 
dot netÖеÄÊý¾ÝÀàÐÍ       &n ......

sql ϵͳº¯Êý

1.×Ö·û´®º¯Êý
³¤¶ÈÓë·ÖÎöÓà 
datalength(Char_expr) ·µ»Ø×Ö·û´®°üº¬×Ö·ûÊý,µ«²»°üº¬ºóÃæµÄ¿Õ¸ñ  
substring(expression,start,length) ²»¶à˵ÁË,È¡×Ó´®  
right(char_expr,int_expr) ·µ»Ø×Ö·û´®ÓÒ±ßint_expr¸ö×Ö·û  
×Ö·û²Ù×÷Àà  
upper(char_expr) תΪ´óÐ ......

¹ØÓÚsql where id in ת»»³ÉÊý¾ÝÀàÐÍ int ʱʧ°Ü

ÓÐÖ´ÐÐsqlÌõ¼þÓï¾äwhere id in(@²ÎÊý)µÄʱºò£¬Èç¹û´¦Àí²»µ±£¬¾Í»á³öÏÖÎÊÌ⣺
ÈçÏÂÃæÕâ¸ö´æ´¢¹ý³Ì£º
alter proc Web_gettwtwgoldgameserverGoldSell
@ID int
as
declare @twgoldsellID nvarchar(1000)
select @twgoldsellID=twgoldsellID from twgoldgameserver where ID=@ID
set @twgoldsellID=replace(@twgoldsell ......

¡¾×ªÔØ¡¿Java/Hibernate/±ê×¼SQL Êý¾ÝÀàÐͶÔÓ¦±í


JavaÊý¾ÝÀàÐÍ
HibernateÊý¾ÝÀàÐÍ
±ê×¼SQLÊý¾ÝÀàÐÍ
(PS:¶ÔÓÚ²»Í¬µÄDB¿ÉÄÜÓÐËù²îÒì)
byte¡¢java.lang.Byte
byte
TINYINT
short¡¢java.lang.Short
short
SMALLINT
int¡¢java.lang.Integer
integer
INGEGER
long¡¢java.lang.Long
long
BIGINT
float¡¢java.lang.Float
float
FLOAT
double¡¢java.lang.Doubl ......

SQL Server ÖÇÄܸÐÖª²å¼þSQL Prompt 4(ÓÐͼÓÐÕæÏà)

²»Åç¿ÚË®!Ö±½ÓÉÏͼ
1.Êý¾Ý¿â¶ÔÏó¼ìË÷¹¦ÄÜ  
 
2.T-SQLÓï·¨°ïÖú
 
 3.³£Óú¯Êý°ïÖú(²»¶®ÄñÓï?13×Ô¼ºÁ·Á·°É!)
 
Download Now 
°²×°Á÷³Ì:
1.ÏȰÑÍøÂçßDzæÁË(¶ÏÍø - -!!)
2.°ÑËùÓеÄSQL Server,VS¶¼¹ØÁË,ÔËÐÐSQLPrompt 4.0.exe°²×°
3.°²×°Íê±Ïºó,Í˳öRedGate.SQLPrompt.TrayApp ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ