create table table_name ( subjectId int, --¿Î³Ì name nvarchar(20), --ÐÕÃû score numeric(12,2), --·ÖÊý class int --°à¼¶ )
²éѯ½á¹û£º subjectId name score subjectId name score 1 xx 50 1 yy 60 2 xx 75 2 yy 96 3 xx 85 3 yy 48 4 xx 70 1 zz 70
½âÊÍһϣºÖ÷ÒªÊÇ·ÖÁ½ÁÐÈ¥²éÕҼǼ£¬×ó±ßµÄ½á¹ûÊÇ´Óclass=1²é³öÀ´µÄ£¬ÓұߵĽá¹ûÊÇ´Óclass=2²é³öÀ´µÄ£¬ ÒªºÏÔÚÒ»Æð¡£ µ±È»ÁË£¬table_nameÕâ¸ö±íÀïÖ»´æ·ÅÁËÁ½¸ö°à¼¶µÄÐÅÏ¢¡£Èç¹ûÁ½¸ö°à¼¶¿¼ÊԵĿÆÄ¿*ÈËÊý²»ÏàµÈ£¬ÄÇôÉÙµÄÄǸö µÄsubjectId ='',name=''score='' SQL code: select T1.*,T2.* from ( select * from tb where class=1 )T1, ( select * from tb where class=2 )T2 where T1.subjectid = T2.subjectis
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......