safex
safex

Reputation: 2514

Oracle SQL how to get rowmax?

I likely lack the correct vocabulary, which is why my google searches were unsuccessful to achieve the following rowmax type of operation: I want to create a new column that is for each row the maximum of two existing columns and is bounded by 0.

SELECT a,b, rowmax(a,b,0) as c
FROM ...

Upvotes: 0

Views: 109

Answers (1)

GMB
GMB

Reputation: 222432

Use greatest():

greatest(a, b, 0) as c

Upvotes: 2

Related Questions