3
Answers

sql group by clause

varsha dodiya

varsha dodiya

10y
833
1
totalvat rsdiscount %
50052
100022
1200105

i want my result to be calculated as 

(500+5) * 2/100 =a
(1000+2)*2/100=b
(1200+10)*5/100=c
" " " " " 
""""""
""

and result = SUM(a+B+C) rs.

this is what i tried

cmd = new SqlCommand("Select (SUM(P_ttotal)+SUM(P_vatto)* (P_totdis)/100) as dis  from PRO_BILL", conn);

but it is throwing exception P_totdis is not in group by clause....
 help me in this.
any help will be appreciated 

Answers (3)
0
Sam Hobbs

Sam Hobbs

NA 28.7k 1.3m 13y
Just go to this web site's home page and look at the articles. You can start by doing a serach such as:

http://www.c-sharpcorner.com/Search/?sKeywords=database+security+passwords

However this web site's search engine is not as good as it could be, so you should also browse the articles too.
Accepted