MAX
function as shown below:
SELECT MAX(value) FROM TYou can also do it without the MAX function as follows:
SELECT T.* FROM T MINUS SELECT T.* FROM T, T as T2 WHERE T.value<T2.valueor:
SELECT T.* FROM T LEFT JOIN T as T2 ON T.value<T2.value WHERE T2.value IS NULLRelational Algebra:
Using Relational Algebra (RA) syntax, this would be:
\project_{value}(T) \diff \project_{value} ( \select_{value < value2}( \project_{value}(T) \cross \rename_{value2}(\project_{value}(T)) ) )where:
\cross
is the relational cross-product operator\diff
is the relational diff operator\project_{attr_list}
is the relational projection operator\rename_{new_attr_name_list}
is the relational renaming operator\select_{cond}
is the relational selection operator
Wow very helpful thanks!
ReplyDeleteAlgebra is a major component of math that is used to unify mathematic concepts. Algebra is built on experiences with numbers and operations, along with geometry and data analysis. Some students think that algebra is like learning another language. This is true to a small extent, algebra is a simple language used to solve problems that can not be solved by numbers alone. It models real-world situations by using symbols, such as the letters x, y, and z to represent numbers.
ReplyDeleteRolle's Theorem
Thanks a lot! You saved me a lot of time! finding a max in RA is a tricky thing.
ReplyDeleteThank you so much, Fahd!
ReplyDeleteThanks a lot! It was very helpful.
ReplyDeleteThanx a tonne . Your post was very helpful. Wishing you all the best. U seem to be THE BRAIN.
ReplyDelete