我有一個表tbl_usi在mysql中有如下記載:mysql的顯示一行多行
present_date usi_value deal_count ---------------------------------------------------------- 2015-10-13 b1 c1 2015-10-12 b2 c2 2015-10-11 b3 c3
我想寫一個查詢,將做到這一點使用present_date字段選擇當前日期和日期然後將它們一起顯示出來:
present_date usi_value deal_count previous_date previous_usi_value previous_deal_count ---------------------------------------------------------- 2015-10-13 b1 c1 2015-10-12 b2 c2 2015-10-12 b2 c2 2015-10-11 b3 c3 2015-10-11 b3 c3 2015-10-10 b4 c4
我該如何做到這一點。謝謝
相似的問題:https://stackoverflow.com/questions/11509407/add-multiple-rows-in-just-one-row-from-a-single-table – user5226582