OrderID (PK,PK,INT NOT NULL) ProductID (PK,PK,INT NOT NULL) UnitPrice (money,NOT NULL) Quantity (smallint ,NOT NULL)
ÏÖÔÚÒªÔÚÒ»ÌõSQLÓï¾äÖвé³ö max(Quantity) ºÍ Æä¶ÔÓ¦µÄ OrderID, min(Quantity)ºÍÆä¶ÔÓ¦µÄOrderID,µÃµ½Á½Ìõ¼Ç¼£¬¸ÃÔõÃ´Ð´ÄØ£¿ select OrderId, max(Quantity) from OrderDetails group by OrderId union select OrderId, min(Quantity) from OrderDetails group by OrderId
1Â¥Õý½â~~~~~` SQL code: select OrderId,Quantity from tb t where not exists(select 1 from tb where id>t.id) or not exists(select 1 from tb where id<t.id
ÐÞÕý
SQL code: select OrderId,Quantity from tb t where not exists(select 1 from tb where Quantity>t.Quantity) or not exists(select 1 from tb where Quantity<t.Quantity)
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......