Hi, I have 2 tables TBL 1 CREATE TABLE [dbo].[a]( [col0] [int] NOT NULL, [col1] [int] NOT NULL, [col2] [int], [col3] [int] CONSTRAINT [PK_a] PRIMARY KEY CLUSTERED ( [col0] ASC, [col1] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TBL 2 CREATE TABLE [dbo].( [col0] [int] NULL, [col1] [int] NULL, [col2] [int] NULL, [col3] [int] NULL ) ON [PRIMARY] I want to insert all unique record from table b to table a (uniqueness is only based on first 2 columns). Keeping in mind i have 10 million records in table b and cannot insert 1 by 1 records. insert into [a] select col0,col1,max(col2),max(col3) from group by col0,col1. Will this query work? ________________________________________________ Be great in act, as you have been in thought.