sql - transpose columns to rows -


The following questions are employed as expected:

But how do I result in the rows appearing in the column? Can I get it?

  select curdate () as a, two as date_sub (curdate), interval 15 days), date_seub (curdate (interval 30 days) as three Five, date_sub (curdate, interval 75 days), date_sub (curdate), interval 90, date_sub (curdate), interval 45 days), date_sub (curdate), interval 60 days) Day) as seven; | One | Two Three | Four Five Six | Seven | + ------------ + ------------ + ------------ + ---------- - + ------------ + ------------ + ------------ + | 2010-09-27 | 2010-09-12 | 2010-08-28 | 2010-08-13 | 2010-07-29 | 2010-07-14 | 2010-06-29 |  

Expected Result in a Line:

  A 2010-09-27 Two 2010-09-12 Three 2010-08-28 Four 2010-08- 13 Five 2010-07-29 Six 2010-07-14 Seven 2010-06-29 [/ code>   

< P> You can use it for
  Select 'one' as the label, the value union as curdate () all select 'two' as the label, date_sub (Curdate), 15 days in the form of the wall, as the val union label as the union all selected as 'three' label, date_sub (curdate), interval 30 days) All select 'four', date_sub (curdate), interval 45 days) as 'Val' UNION, select all 'seven' as labels in the form of 'Five' label, as the label Values, date_sub (Curdate), as the interval, val_yub (curdate), interval 60 days) 90 days) Val as  

Comments