I need to insert values into a table. But my condition is that I need to select Min(date) from another table and this value should be inserted into another table.
My query
Insert into tempTable values
('Value1','Value2','Value3',(select min(val_dt) from anotherTable),'Y',getdate())
If I use this query I am facing error.
Guide me how to use select query inside the insert query.