27,579
社区成员
发帖
与我相关
我的任务
分享
SELECT a.*,b.qishu
FROM rv_licai a
INNER JOIN (select top 1 qishu,licaiid from rv_duifu order by qishu desc ) b ON b.licaiid=a.id
where shenhe=1 and yiduifu=0 and chanpin in('月息宝','新月息宝','月月万利宝')
order by bdated
SELECT * FROM rv_licai a where shenhe=1 and yiduifu=0 and chanpin in('月息宝','新月息宝','月月万利宝')
AND a.id=(select top 1 licaiid from rv_duifu order by qishu desc )
order by bdated
SELECT * FROM rv_licai a where 1=1 and shenhe=1 and yiduifu=0 and chanpin in('月息宝','新月息宝','月月万利宝') order by bdated
select top 1 qishu,dfdate from rv_duifu where licaiid=a.id order by qishu desc
我要把这两条整合成一条返回一个结果集
select * from tblb t1 inner join tbla t2 on t1.a=t2.b
where t1.qishu= (select max(qishu) from tblb)