| New to using Oracle. Need help! [message #633499] |
Thu, 19 February 2015 12:08  |
 |
jdmas
Messages: 3 Registered: February 2015 Location: California
|
Junior Member |
|
|
Hey everyone,
This is my dilemma, I am trying to find duplicate purchasing ID's and have them labeled as Multi in the next column. This is what I have so far:
if(count (distinct [PURCHASE_ID] ) >1 ) THEN ('MULTI') ELSE ('').
This code does not return an error message, but every row in the column now has Multi in it. I am not sure what I am missing here, so if anyone could help me, I would greatly appreciate it!
|
|
|
|
|
|
|
|
| Re: New to using Oracle. Need help! [message #633502 is a reply to message #633501] |
Thu, 19 February 2015 12:36   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
jdmas wrote on Thu, 19 February 2015 13:23I am using a database (Cognos I believe)
I think then this is a question for a Cognos forum because the above is not valid syntax in Oracle. I believe Cognos is just a reporting tool, not a database, but that's what i remember from years ago and things may have changed.
|
|
|
|
|
|
|
|
| Re: New to using Oracle. Need help! [message #633505 is a reply to message #633502] |
Thu, 19 February 2015 12:41  |
 |
Michel Cadot
Messages: 68781 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
joy_division wrote on Thu, 19 February 2015 19:36jdmas wrote on Thu, 19 February 2015 13:23I am using a database (Cognos I believe)
I think then this is a question for a Cognos forum because the above is not valid syntax in Oracle. I believe Cognos is just a reporting tool, not a database, but that's what i remember from years ago and things may have changed.
In addition I think the formula is wrong.
If you want duplicate "purchase id" then you should not count (distinct purchase id) which return the number of distinct purchase id and not the purchase ids that are duplicated.
|
|
|
|