Click here to Skip to main content
14,668,434 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100