Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Moving data from one table to another

Author  Topic 

darklordpt
Starting Member

3 Posts

Posted - 2008-11-13 : 03:59:09
Hello everybody,

This is my first post here and i´m new in this SQL stuff, so be patient.

I have this 2 tables
1 - 33 columns and 96 rows(Date, time, 1 ...31)

Date | time | 1 | 2 | 3 | ... | 31
01-01-2008 | 00:00 | 1 | 1 | 0 | ... | 0
:
01-31-2008 | 00:00 | 1 | 1 | 0 | ... | 0

2 - 5 Columns and n number of rows

I wanna know how can i transfer the data from the first table to the second, when the value is 0 send the value to the 2nd and 3rd column on the second table and when the value is 1 send the value to the 1st column so the second table should look like this:

Date | Time | a | b | c
01-01-2008 | 00:00 | 1 | 0 | 0
:
01-31-2008 | 00:00 | 1 | 0 | 0

Thanks every one for the help, if you have any questions please ask

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2008-11-13 : 04:37:55
From which column you want to check value (it is 1 or 0) out of 1-31 columns of your table ?
Go to Top of Page

darklordpt
Starting Member

3 Posts

Posted - 2008-11-13 : 04:52:52
Hi,

i have to check all lines for 0 or 1 and send the value to the specified column

Thanks for your reply
Go to Top of Page

darklordpt
Starting Member

3 Posts

Posted - 2008-11-13 : 11:23:30
Hello,

No answer. Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-13 : 11:34:20
cant really understand you rule of transfer. can you explain clearly please?
Go to Top of Page
   

- Advertisement -