SQL Language (MOSC)

MOSC Banner

How to identify multi values in a column in select cause?

edited Jun 25, 2019 8:44AM in SQL Language (MOSC) 4 commentsAnswered ✓

Hello there,

I have a long query statement with some sub-queries in it for POs.  For a PO with more than 1 line, I need to identify if the values in a column are the same or different.  For example:

Column name in po_lines_all table: Attribute1.  I need to see if the values in attribute1 are the same or different for a PO.  In my script, if they are the same, returns that value, when they are different, returns something like 'XXXXX'.  I don't think count(*) > 1 can handle this.

I tried decode and it didn't work: decode (pha.attribute1, pha.attribute1, pha.attribute1, 'XXXXX')  attribute1

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center