Skip to content
Advertisement

Comparing two column values in postgres

I have table having following columns and records. I need to compare the two column values(ColumnA and ColumnB), if ColumnB>ColumnA then and update the third column from ‘N’ TO ‘Y’

I need to update Result Column=’Y’ for first and third row because columnB>ColumnA

Result

Advertisement

Answer

Hope this will help.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement