DaniCol Posted August 20, 2014 Share Posted August 20, 2014 RcptNo Discoount ProductCode Price 111 10 1122 1000 111 10 1123 1500 111 10 1124 2000 123 20 1123 2000 124 30 1125 1000 124 30 1120 2000 I want This Result Rcpt No:111 Discount :10 TOT price :1000+1500+2000-10=------; By Which Query This Result can be Obtained Link to comment Share on other sites More sharing options...
JamesB Posted August 20, 2014 Share Posted August 20, 2014 not sure if this will work, but worth a shot. SELECT RcptNo, Discount, ProductCode, ((SELECT SUM(Price) FROM table WHERE RcptNo = 111) - Discount) as TotalPrice FROM table WHERE RcptNo = 111 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now