473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Duplicate Column

Hi,

I have a column which I need to duplicate with the excat enteries.

I have column name jDateComplete which I need to duplicate with DateComplete.

Can somebody please help me with this?

Thanks,

Aash.
Oct 24 '06 #1
5 8534
scripto
143 100+
Hi,

I have a column which I need to duplicate with the excat enteries.

I have column name jDateComplete which I need to duplicate with DateComplete.

Can somebody please help me with this?

Thanks,

Aash.
update Table
set jDateComplete = DateComplete
Oct 24 '06 #2
Hi,

I tried the update statement and it has put NULL values in both of the columns in my table.

Please let me know If I am doing something wrong.

Thanks,

Aash.
Oct 24 '06 #3
scripto
143 100+
I assumed that one column already had data in it - if that is not the case then update/insert your table as normal

e.g.

update mytable
set col1 = somedata,
col2 = somedata

insert into mytable col1, col2
values(somdata, somdata)
Oct 25 '06 #4
Hi,

Yes the jDateComplete has got data in it.

Thanks
Oct 26 '06 #5
scripto
143 100+
assuming your table has an ID column - this will do the trick
substitute ID for your table's primary key

declare @counter int, @MaxID int
set @counter = (select min(id) from mytable)
set @MaxID = (select max(id) from mytable)

while @counter <= @MaxID
begin
update mytable
set jDateComplete = (Select DateComplete from mytable where id = @counter)
where id = @counter

set @counter = @counter + 1
end
Oct 26 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Richard | last post by:
Hi Everyone, I have a table in which their is record which is exactly same. I want to delete all the duplicate keeping ony 1 record in a table. Example Table A Empid currentmonth ...
0
by: Alpha | last post by:
I have a dataset containing a table as a data source for a list box in the windows application depending on which radio button the user selects. The table is disposed when the user clicks on other...
1
by: Andy L | last post by:
I have two identical databases running on two separate servers. I want to add a column to the following table: classified_cats { acid , name , parent } Running ALTER TABLE `classified_cats`...
1
by: sgCool | last post by:
My data is like Below: id abc def ---- --------- ------------------------------ 1 1.584795 2006-11-04 13:36:06.0 2 1.584795 2006-11-04...
4
by: ramdil | last post by:
Hi All I have table and it have around 90000 records.Its primary key is autonumber field and it has also have date column and name, then some other columns Now i have problem with the table,as my...
1
by: Pat_RI | last post by:
I have a table with columns called Part1,Part2,Part3,Part4 and I would like to export them to Excel but have each column called Part. Is this possible without doing it manually? I would like the...
1
by: jerelp | last post by:
I need to make a macro that finds duplicate records in Column A in sheet1 and Column A in sheet2. If there is a duplicate I need both to be highlighted in red. If there is no duplicate in Column A...
5
by: neelmukhopadhya | last post by:
hi there, i need a help, it is very urgent. i have table like column1 column2 a a a b a b a c a d
3
by: Karoly | last post by:
I have a report which shows two columns - staff number and visit date. For a staff number (which is unique) there may be more than one visit date. But I want to list a staff number only once and not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.