Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I hanve data with more then one row ,I have a column where i want to show column value into the text box.

But unfartunate it get sum of all value in same column.


eg

dataset structer

id name marks totalmarks
1 kapil 10 50
2 kapil 20 50
3 kapil 20 50


now i want to show Total marks in text box but i get Totalmakks=150


please give me idea


thanks in advance.......




kapil dev (Jr. Team Leader offbeat software solution pvt. Limit.)
Posted
Comments
Abhisar Garg 17-Jan-14 4:54am    
select distinct name,totalmarks from table_name...

thats it...
Dinesh.V.Kumar 20-Jan-14 6:59am    
use the below query -
Select name, sum(marks) from table_name Where <condition> group by name

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900