Home  >  Article  >  Backend Development  >  smarty 数据分类

smarty 数据分类

WBOY
WBOYOriginal
2016-06-23 13:15:551020browse

假如有一张表,如下:
id  |   dt                  |      title    |      
  1  | 2010/09/01   |      111    |     
  2  | 2010/10/01   |      222   |    
  3  | 2011/09/01   |      333   |    
  4  | 2011/12/01   |      444   |    
  5  | 2012/01/01   |      555   |    
  6  | 2013/09/01   |      666   |    
  7  | 2014/08/01   |      777   |    
  8  | 2015/03/01   |      888   |    
  9  | 2015/04/01   |      999   |    
 ...  |   ......                |      ....     |


在不增加字段,不关联其他表的情况下有没有办法可以按照时间分类    比如  
2010  :  111
               222
2015  :  888
               999

这样。  求解


回复讨论(解决方案)

2010:111
2010:222

然后在自己处理下?应该不能返回你说的那样一行,数据是返回查找表中的一行,你那样的怎么算一行。

2010:111
2010:222

然后在自己处理下?应该不能返回你说的那样一行,数据是返回查找表中的一行,你那样的怎么算一行。



2010  :  111
               222
2015  :  888
               999
是在页面显示的结果,其实我也觉得不大可行。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn