Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
suresh0534
Starting Member
3 Posts |
Posted - 2012-02-14 : 20:03:27
|
Hi,I have table Student with these columns names student_code , stud_act_id , fee , discount_rate A 52165 200 60 A 54902 300 50 A 54167 100 30 B 54165 60 B 54167 30 B 54902 50I want query to display the values like:Here Discount Fee value takes from the student_code fee and discount_rate .Discount Fee: (200-(60+(60*10)/100)).Discount Fee: (300-(50+(50*10)/100)).Discount Fee: (100-(30+(30*10)/100)).The discount Fee value will taking form the student_code of A of discount_rate and fee and result append to the Student_code BThe out put should like this:student_code , stud_act_id , fee , discount_rate A 52165 200 60 A 54902 300 50 A 54167 100 30B(Discount Fee:134) 52165 60B(Discount Fee:245) 54902 50B(Discount Fee:67) 54167 30Please give me solution how to write the query...Thanks, |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-02-14 : 20:45:08
|
Will you have another more than 1 student_code per stud_act_id ? like Student_code C , D etc ? How would the expected result looks like ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|