+ 1
Sql query for aggregate function for a record.
Name sub1 sub2 sub3 max/min Ajay 80 78 90 null Vinay 78 65 89 null Rita 70 89 75 null Here i want to calculate maximum,minimum of sub1, sub2, sub3 for each record. Aggregate function works along columns not on records. So anyone help to write sql query to calculate for each records.
2 Réponses
+ 2
Hope this will help you
https://stackoverflow.com/questions/14877797/how-to-sum-two-fields-within-an-sql-query
+ 1
In some databases there are LEAST and GREATEST functions with which you could do this:
LEAST(sub1,sub2,sub3)
These functions return the min/max from a list of values