Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gangadharye
Starting Member
3 Posts |
Posted - 2011-05-09 : 13:28:56
|
| How to select the maimum value from the below tabletabe name: Ganga b c d4 9 1 514 19 11 9564 39 41 3574 45 51 65Gangadhar Y |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2011-05-09 : 13:32:40
|
| you mean the maximum value accross all columns and all rows? or the maximum value of a specific column?check out Books Online for the MAX function.Be One with the OptimizerTG |
 |
|
|
gangadharye
Starting Member
3 Posts |
Posted - 2011-05-10 : 00:30:19
|
| Hi TG,to select the maximum value in the table eg: 95 is maximum value in the tableGangadhar Y |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2011-05-10 : 13:28:42
|
There's no real slick and efficient way to do that. The need itself may be a sign that the database design is not good. But one way could be:select max([allCols])from ( select max(a) as [allcols] from gang union select max(b) from gang union select max(c) from gang union select max(d) from gang ) d Be One with the OptimizerTG |
 |
|
|
gangadharye
Starting Member
3 Posts |
Posted - 2011-05-11 : 01:03:17
|
| Thanks TG for the help...Gangadhar Y |
 |
|
|
|
|
|