| Author |
Topic |
|
waitinghyhy
Starting Member
2 Posts |
Posted - 2011-06-22 : 13:08:40
|
| Hi I'm very new to SQL Server 2008.Now I have a table: ID InsurerID BranchID ClaimNumber PolicyNumber DateOfAccident col 999 Aviva 22 N209 XY-1234 9/1/2010 1001 Aviva 22 N209 XY-1234 9/1/2010 9991003 AXA 24 A900 XY1234 9/5/2010 1000 Co-op 11 123456789 AB13579 9/6/2010 1002 Co-OP 11 123456789 AB13579 9/6/2010 1000 The original table doesn't have the last column "col", but my ultimate goal is to add this column which has the ID of duplicates. Does anyone could help me on this? Thanks |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-06-22 : 13:22:50
|
please provide yoru sample data as suchdeclare @insurance table(id int, InsurerID nvarchar(255), BranchID nvarchar(255), ClaimNumber nvarchar(255), PolicyNumber nvarchar(255), DateOfAccident date, col int)insert into @insurance(ID, InsurerID, BranchID, ClaimNumber, PolicyNumber, DateOfAccident, col)SELECT 999, 'Aviva', '22', 'N209', 'XY-1234', '9/1/2010', 01001 Aviva 22 N209 XY-1234 9/1/2010 9991003 AXA 24 A900 XY1234 9/5/20101000 Co-op 11 123456789 AB13579 9/6/20101002 Co-OP 11 123456789 AB13579 9/6/2010 1000 the clearer and thorougher your request the easier you will get help.If you don't have the passion to help people, you have no passion |
 |
|
|
waitinghyhy
Starting Member
2 Posts |
Posted - 2011-06-22 : 13:37:14
|
| I'm sorry if I didn't state it clear...declare @insurance table(id int, InsurerID nvarchar(255), BranchID nvarchar(255), ClaimNumber nvarchar(255), PolicyNumber nvarchar(255), DateOfAccident date, col int)insert into @insurance(ID, InsurerID, BranchID, ClaimNumber, PolicyNumber, DateOfAccident, col)SELECT 999, 'Aviva', '22', 'N209', 'XY-1234', '9/1/2010', 1001,'Aviva', '22', 'N209', 'XY-1234', '9/1/2010', 9991003, 'AXA', '24', 'A900', 'XY1234', '9/5/2010'1000, 'Co-op', '11', '123456789', 'AB13579', '9/6/2010'1002, 'Co-OP', '11', '123456789', 'AB13579', '9/6/2010', 1000is this a better way to present my data? |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-06-23 : 16:18:29
|
| what happens when you try it?what defines duplicate?If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|