I am new to sql and I am struck in one of the requirement where I need to insert data into a table table1(col1,col2,col3) where col1 is primary key, unique number, and col2 and col3 are string. I will be getting col2 and col3 from table2 where col3 is unique column in table2. I am using something like this but getting some errors. Could you correct me ?
Insert into table1(col1, col2, col3) select max(col1)+1, colz,colyy from table2, table1 ;
Any help would be appreciated.