Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
row to column |
Mon, Mar 10 2008 8:28 AM | Permanent Link |
silven | Is it possible to convert a single row query result to column format or query result with 2 rows
Table a --------- col1 | col2 | col3 | col4 21.9 23.4 25.6 27.8 as col1 21.9 col2 23.4 col3 25.6 col4 27.8 Thanks, Silven |
Mon, Mar 10 2008 10:41 AM | Permanent Link |
Fernando Dias Team Elevate | Silven
Not tested, may have syntax errors, but as a first approach you can try something like this: select 'col1' as ColName, col1 as ColValue from Table1 union select 'col2' as ColName, col2 as ColValue from Table1 union select 'col3' as ColName, col2 as ColValue from Table1 union select 'col4' as ColName, col2 as ColValue from Table1 -- Fernando Dias silven escreveu: > Is it possible to convert a single row query result to column format or query result with 2 rows > > Table a > --------- > > col1 | col2 | col3 | col4 > 21.9 23.4 25.6 27.8 > > > as > > col1 21.9 > col2 23.4 > col3 25.6 > col4 27.8 > > Thanks, > Silven > |
Mon, Mar 10 2008 3:53 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Silven,
<< Is it possible to convert a single row query result to column format or query result with 2 rows >> Fernando's version should work just fine. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Monday, May 6, 2024 at 12:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |