ÒýÓà 13 Â¥ acmain_chm µÄ»Ø¸´:
SQL codeselecttop3*from t_reyoreyoreyo twhere nclassid='Bush'andnotexists (select1from t_reyoreyoreyowhere nclassid='Bush'and O_Id <t.O_Idand (opertiontime=t.opertiontimeor unitprice=t.unitprice
¡
select top 6 * from "+enttable+" t where nclassid=? and not exists ( select 1 from "+enttable+" where nclassid=? and goodsid <t.goodsid and (opertiontime=t.opertiontime or unitprice=t.unitprice) ) order by opertiontime desc
ÎÒ»¹ÏëÏÔʾ "+usitable+" ÖÐµÄ company ×Ö¶Î,"+usitable+"Óë "+enttable+" ͨ¹ý
"+usitable+".username="+enttable+".buyform
ÎÒÕâÑùд²»ÐÐ
select top 6 * from "+enttable+" t where nclassid=? and not exists ( select 1 from "+enttable+","+usitable+" where "+usitable+".username="+enttable+".buyform and "+usitable+".nclassid=? and goodsid <t.goodsid and (opertiontime=t.opertiontime or unitprice=t.unitprice) ) order by opertiontime desc
Íû¸ßÊÖ°ïæ°¡
û¿´¶®ÄãµÄÐèÇó¡£
½¨ÒéÄãÓÃЩÀý×Ó˵Ã÷¡£
½¨ÒéÄãÁгöÄãµÄ±í½á¹¹£¬²¢Ìṩ²âÊÔÊý¾ÝÒÔ¼°»ùÓÚÕâЩ²âÊÔÊý¾ÝµÄËù¶ÔÓ¦ÕýÈ·½á¹û¡£
ÎÒÏëʵÏÖ£º²éѯָ¶¨±íµÄ("+enttable+" )µÄÖ¸¶¨·ÖÀà(nclassid=?)µÄ,²»Í¬Ê±¼ä(opertiontime)²»Í¬¼Û¸ñ(unitprice)µÄǰ3Ìõ¼Ç¼¡£