In SQL, 5 members are register the 1st member will refer the other 4 so we put commision as
1st member got-50%
other 4 members got-10%
how i calculate it?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Muhammad Shahid Farooq107 reputationPosted May 11, 2012, 10:01 PM EDT
Pardeep Malik129 reputationPosted May 11, 2012, 10:02 PM EDT
you can create a trigger or store procedure for that
Let we have a table to insert amount to the table of customer and as you enter the amount value also reflects to commission table.
as
create trigger com1 on custmor for insert
as
declare @amt float
select @amt=amount from inserted ----amount is the column for inserting amount in customer table
declare @m1com float
declare @m2com float
declare @m3com float
declare @m4com float
declare @m5com float
set @m1com=@amt*50/100 ---Calculating commission for 1st memeber
set @m2com=@amt*10/100
set @m3com=@amt*10/100---Calculating commission for other memebers
set @m4com=@amt*10/100
set @m5com=@amt*10/100
inset into commission1 values(.....,@m1com,@m2com,@m3com,@m4com,@m5com,....) ---adding commission of memebers with other values in table
Note - Trigger automatically called when value is ineserted
Bhabani prasad Dash168 reputationPosted May 14, 2013, 10:57 PM EDT
Kunal VaishyaRank #990 · 2K reputationPosted May 11, 2012, 9:54 PM EDT