Showing posts with label invamt. Show all posts
Showing posts with label invamt. Show all posts

Friday, February 10, 2012

Convert columns

Hi,
I have some data in one table.
I need to get the data in the same table, into different rows.
I mean to say that, I have data like
InvNo InvAmt GstAmt
12 1900 79

and I need to get data like

InvNo Amt
12 1900
12 79

Can anyone help me as to how can i get data in this format.

Thanks.SELECT InvNo, InvAmt AS AMT
UNION ALL
SELECT InvNo, GstAmt AS AMT

???????????|||1. Create a second dummy table with the format that you want.
2. Transfer the data to the new table
3. Delete the original table
4. Rename the dummy table to the original name

Regards