建一個(gè)table:product ,格式如下
name price data
三星硬盤 800 6.21
三星硬盤 700 6.10
聯(lián)想硬盤 600 7.29
聯(lián)想硬盤 500 7.12
查詢結(jié)果要求:查出來每種硬盤的最新價(jià)格;
查詢的結(jié)果為:
name price data
三星硬盤 800 6.21
聯(lián)想硬盤 600 7.29
1.select name,price,dates from product where dates="select max(dates) from product group by name"
2.select name,price,dates from product where dates in(select max(dates) from product group by name)
3.select name,price,dates from product where (name,dates)=(select goods,max(dates) from product group by name)

遠(yuǎn)近互聯(lián)技術(shù)-劉 整理發(fā)布,希望能對(duì)同是技術(shù)的你有所幫助。
遠(yuǎn)近互聯(lián)專業(yè)提供網(wǎng)站建設(shè)、APP開發(fā)、網(wǎng)站優(yōu)化、外貿(mào)網(wǎng)站SEO、微信運(yùn)營的品牌整合營銷服務(wù),讓客戶通過網(wǎng)絡(luò)品牌建立與網(wǎng)絡(luò)傳播提高業(yè)績。






