What is the the query for inserting data into a self-referencing table. My table has 4 columns: SlNo
, Name
, ParentId
, CurrentBanlance
.
I tried this SQL query but it doesn't execute, is there any another way?
INSERT INTO Ptr_AcntInfo
SELECT
'" + txtAcName.Text + "',
(SELECT [SlNo] FROM Ptr_AcntInfo WHERE [Ac_Nm] = '" + cbxAcntGrpName.Text + "'),"+0.00+""
In this query I am getting the below error.
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.