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
 how update all column in big table

Author  Topic 

bewek
Starting Member

7 Posts

Posted - 2010-10-19 : 04:32:13
I need advice on how I can do one update the entire table. I have a table where it is stored: time, category number and serial number. The table has several thousand lines. I need all rows to make all the serial numbers added one character. So I need this data as SELECT to choose a character to add and update. Using conventional UPDATE It's impossible right? They say it is a temporary table, but I do not know how to do it. Written by someone to wash an example so I can do. Thank you. The table in Oracle (PL / SQL).

Sachin.Nand

2937 Posts

Posted - 2010-10-19 : 04:53:54
Post some sample data of what you want.

PBUH

Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-19 : 04:54:57
Or better try to get help in an oracle forum?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

bewek
Starting Member

7 Posts

Posted - 2010-10-19 : 07:16:43
I have table with:

date category serial_number
2010-10-02 09:21:08 OH 685809456756
2010-10-02 09:22:08 BM 668685865869
2010-10-02 09:23:08 CC 683234234236
2010-10-02 09:25:08 OH 685808909876

I need

date category serial_number
2010-10-02 09:21:08 OH 685809456756T
2010-10-02 09:22:08 BM 668685865869T
2010-10-02 09:23:08 CC 683234234236T
2010-10-02 09:25:08 OH 685808909876T

Table has 20 thousand rows.
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-10-19 : 07:32:08
If the datatype of serial_number is varchar then the following query will work


Update yourtable set serial_number= serial_number + '' + 'T'


PBUH

Go to Top of Page

Devart
Posting Yak Master

102 Posts

Posted - 2010-10-19 : 07:42:59
Hi,

For example:

UPDATE <your_table_name>
SET serial_number=serial_number || 'T';

Best regards,

Devart,
SQL Server Tools:
dbForge Schema Compare
dbForge Data Compare
dbForge Query Builder
Go to Top of Page

bewek
Starting Member

7 Posts

Posted - 2010-10-19 : 08:04:05
Thank you very very much. I can not wait to try it at work. You've helped me. :)
Go to Top of Page
   

- Advertisement -