计算父母和子女的佣金

计算父母和子女的佣金

本文介绍了计算父母和子女的佣金的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,我创建一个表如下



hi friends i create one table as below

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)







CREATE TABLE [dbo]。[regi](



[id] [int] IDENTITY(1,1)NOT NULL,

[sponserid] [varchar](50)NULL,

[introducername] [ varchar](50)NULL,

[placementunderid] [varchar](50)NULL,

[name] [varchar](50)NULL,

[so] [varchar](50)NULL,

[position] [int] NOT NULL,

[性别] [int] NOT NULL,

[职业] [varchar](50)NULL,

[dob] [varchar](50)NULL,

[addr] [varchar](200)NULL,

[area] [varchar](50) NULL,

[city] [varchar](50)NULL,

[区] [varchar](50)NULL,

[状态] [varchar](50)NULL,

[密码] [varchar](50)NULL,

[email] [varchar](50)NULL,

[固定电话] [varchar](50)空,

[mobileno] [varchar](50)空,

[pwd] [varchar]( 50)NULL,

[pin] [varchar](50)NULL,

[nominee] [varchar](50)NULL,

[关系] [varchar](50)NULL,

[年龄] [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_PADDIN G OFF GO





1.在此表中,sponserid是表的父级。

2。 name是父级的子级。

3.位置表示左右。

4.此条件是父母必须有2个孩子(仅限**左右)。

5.对于第一位父母必须离开+右+左(或)左+右+然后在每个孩子添加250 rs
$ b $后为父母计算为500 rs b

任何人都可以帮我编写左右位数的代码并计算特定孩子的卢比。

==




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


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.
==

推荐答案


这篇关于计算父母和子女的佣金的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:57