Friday, 15 May 2015

php - MySQL query group name but display other rows with limit -



php - MySQL query group name but display other rows with limit -

table +----+-----+------------+ |col1|col2 |col3 | +----+-----+------------+ |a |one |1-jul-2013 | |a |two |2-jul-2013 | |a |three|3-jul-2013 | |a |four |4-jul-2013 | |a |five |5-jul-2013 | |b |one |1-jul-2013 | |b |two |2-jul-2013 | |b |three|3-jul-2013 | |b |four |4-jul-2013 | |b |five |5-jul-2013 | |b |six |6-jul-2013 | |b |seven|7-jul-2013 | |b |eight|8-jul-2013 | |c |one |1-jul-2013 | |c |two |2-jul-2013 | |c |three|3-jul-2013 | |c |four |4-jul-2013 | |c |five |5-jul-2013 | |d |one |1-jul-2013 | |d |two |2-jul-2013 | |d |three|3-jul-2013 | |d |four |4-jul-2013 | |d |five |5-jul-2013 | +----+-----+------------+

i display this:

+-----+------+------------+------------+------------+ |group|name |date |name |date | +-----+------+------------+------------+------------+ | |one |1-jul-2013 |two |2-jul-2013 | | b |one |1-jul-2013 |two |2-jul-2013 | | c |one |1-jul-2013 |two |2-jul-2013 | | d |one |1-jul-2013 |two |2-jul-2013 | +-----+------+------------+------------+------------+

why want that? having same column names next each other makes bit hard figure out 1 need. far know, it's not possible have duplicate column names.

php mysql group

No comments:

Post a Comment