I wanted to select the last record from the table1 and insert into another table .Here is my query.
Insert into table2 values(select top 1 col1,col2 from table1 order by id desc).
I know for adding the value into table,need to be in cotation.But where to add?
You can select literals to fill in the other columns that
table1can’t provide, something like this:Any columns you do not name in the column list will get the default value, or
nullif no default is defined.The number and type of columns selected must match the number and type of columns in the insert column list.