引用 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条记录。
相关问答:
_RecordsetPtr CMyAdo::SelectRecord(string &where, string &tablename,string &field, int way )
{
int ret = 0;
_RecordsetPtr pset;
CString sql;
& ......
表结构:
ProductSeriesID 自动编号
ProductSeriesName 文本
ProductSeriesRemark 备注
执行前
ProductSeriesID ProductSeriesName ProductSeriesRemark
2 LV铣刀系列 LV铣刀系列
3 钨钢舍 ......
这两天学习《Delphi技术方案宝典》一书中第三章关于用户登录方案的例子,利用的是SQl Server数据库实现用户登录,编译运行都没问题,该实现的功能也都实现的很好,但是奇怪的是,反复运行一段时间后,有时在关闭整个 ......
我的一个access数据库中的photo字段中的内容是这样的:
|/UpFiles/Picture/admin/200910162300187612.jpg|/UpFiles/Picture/admin/200910162300187612.jpg||||/UpFiles/Picture/admin/200910162300187612.jp ......