select stockitem,min(unitprice)
from (select top 1 stockitem,PriceAV as unitprice from table1 order by hkdate desc
union
select top 1 stockitem,PriceRecas unitprice from table1 order by recDatedesc )
from (select top 1 stockitem,PriceAV as unitprice from table1 order by hkdate desc
union
select top 1 stockitem,PriceRecas unitprice from table1 order by recDatedesc )
解决方案 »
- 数据表列合并后,模糊查询的问题
- MS SQL2005安装出错!
- 〇〇〇〇〇请教下这种情况下该如何正确地存储值?〇〇〇〇〇
- 还得提问,继续昨天的binary字段问题,,Herb2 ,qianjin036a 请再帮忙看看?
- 这样的数据导入问题困扰了我好久了。
- sqlserver数据的float型的问题??
- 对我难可是对您简单啊!存储过程的问题!!急急急啊!!
- 干了通宵、搞不定、各位高手帮帮忙
- 把一台机器上的SQL 2000数据库实时的同步插入到另一台机器上的数据库
- 需要超级大侠的指点!!!要得到这样的结果SQL如何写?
- 按时间段根据月份分组查询,如何将截断的月份对应的统计数置“0”,而不是没有相应月份的统计信息
- 很急,存储过程的问题
a.PriceAV
from table1 a,
table2 b
where a.stockitem = b.stockitem
stockitem,
min(PriceAV)
from 表1
group by stockitem
order by hkdate desc
union all
select
stockitem
min(PriceRec)
from 表2
group by stockitem
order by recDate desc