hi friends i create one table as below
1. in this table sponserid is the parent of the table.
2. name is the child of the parent.
3. position indicates left and right.
4. here condition is parent must have 2 childs (**left and right only ).
5. For the first parent have to left + right+ left (or) left +right + right then it calculate to 500 rs for the parent after every child add 250 rs
Can any one help me to write the code for count left and right position and calculate rupees for particular child.
==
if 3 childs in one parent then we have to give the comission 500 and after for every child comission increase to 250(500 + 250 = 750)
Code:
CREATE TABLE [dbo].[regi]( [id] [int] IDENTITY(1,1) NOT NULL, [sponserid] [varchar](50) NULL, [introducername] [varchar](50) NULL, [placedunderid] [varchar](50) NULL, [name] [varchar](50) NULL, [so] [varchar](50) NULL, [position] [int] NOT NULL, [gender] [int] NOT NULL, [occupation] [varchar](50) NULL, [dob] [varchar](50) NULL, [addr] [varchar](200) NULL, [area] [varchar](50) NULL, [city] [varchar](50) NULL, [district] [varchar](50) NULL, [state] [varchar](50) NULL, [pincode] [varchar](50) NULL, [email] [varchar](50) NULL, [landline] [varchar](50) NULL, [mobileno] [varchar](50) NULL, [pwd] [varchar](50) NULL, [pin] [varchar](50) NULL, [nominee] [varchar](50) NULL, [relation] [varchar](50) NULL, [age] [varchar](50) NULL, [bankpayeename] [varchar](50) NULL, [accno] [varchar](50) NULL, [bankname] [varchar](50) NULL, [branch] [varchar](50) NULL, [ifsc] [varchar](50) NULL, [createddate] [datetime] NULL) ON [PRIMARY]GO SET ANSI_PADDING OFF GO
2. name is the child of the parent.
3. position indicates left and right.
4. here condition is parent must have 2 childs (**left and right only ).
5. For the first parent have to left + right+ left (or) left +right + right then it calculate to 500 rs for the parent after every child add 250 rs
Can any one help me to write the code for count left and right position and calculate rupees for particular child.
==
if 3 childs in one parent then we have to give the comission 500 and after for every child comission increase to 250(500 + 250 = 750)
Comment