Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Compare column in two tables Expand / Collapse
Author
Message
Posted Wednesday, January 9, 2008 5:19 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 8, 2009 9:33 AM
Points: 12, Visits: 21
Hi

I would like to compare rows which are in two different tables which have the same column and data type where the data in one table1 column (A) has repeated data. When new data is added to table1 column (A) the unique rows should be selected and added to another table2 column (A) on the same database.

Both tables have the same column name but the rows in table1 column (A) are repeated while the rows in table2 column (A) are unique.

Data is always added to table1 columnA everyday. How do i selected only the unique rows in table1 column (A) and add it to table 2 (A). To give an idea there are about 50,000 rows in table1 column (A) and about 1000 rows in table 2 column(A)

Any help is much appreciated. New to SQL so please give in detail.

Thanks.
Post #440545
Posted Wednesday, January 9, 2008 6:37 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 12:34 PM
Points: 31,181, Visits: 15,626
Please don't cross post.

Answered here: http://www.sqlservercentral.com/Forums/Topic440533-338-1.aspx







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #440580
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse