在制作样本详细信息页面时,我只是陷入了一个非常令人困惑的情况.我真正想要做的是这样的:
+----------------------------------------------------+ + Year | Month | Date | Total Gain + +----------------------------------------------------+ + 2003 | January | 26/01/2003 | +90 % + + 2003 | January | 27/01/2003 | +10 % + + 2003 | Feburary| 01/02/2003 | -29 % + + 2003 | Feburary| 15/02/2003 | +0.52 % + +----------------------------------------------------+
我真正想要的是我可以像MysqL_query一样列出月份名称和年份(‘SELECT month FROM mytable WHERE year =“2003”’);
我认为你正在寻找的是DISTINCT查询,即
原文链接:https://www.f2er.com/php/130736.htmlSELECT DISTINCT year,month FROM mytable