Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
to get max value from database and that max value should show as a separate column in gridview to all rows by select query
Posted

Use max in your sql, and the data will be in a column and show in your grid.

Select max(x) from y
 
Share this answer
 
Comments
Bhargav.456 9-Jan-13 0:22am    
i did the same one, but i used group query, its showing maximum of there particulars.
i need max value of column from database and show the all the values in grid view in that grid view i want max value should show in separate column.
Christian Graus 9-Jan-13 0:24am    
The answer then is to fix your SQL so the value is what you want
Bhargav.456 9-Jan-13 0:26am    
please explain clearly
Christian Graus 9-Jan-13 0:27am    
It doesn't get any clearer. Your column contains the data you asked for. Ask for the data you need. Don't ask this again, the answer won't change. If you don't know SQL, post your SQL, your table structure, and details of what you need and hope someone here does your job for you
Bhargav.456 9-Jan-13 0:44am    
data base like this

id code qty osno
1 2 10 1
2 3 10 2
3 4 10 3
4 6 10 4
5 7 10 4

my question is to get max of osno value should show in a gridview as separate column
as well as the database also

i need gridview like this to show an output

id code qty osno max no
1 2 10 1 4
2 3 10 2 4
3 4 10 3 4
4 6 10 4 4
5 7 10 4 4
query should be like this :
select *,(select MAX(salary) from emp) as maxsalary from emp
 
Share this answer
 
Comments
Christian Graus 9-Jan-13 3:05am    
That is awful. Truly awful

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