Home » SQL & PL/SQL » SQL & PL/SQL » New to using Oracle. Need help!
New to using Oracle. Need help! [message #633499] Thu, 19 February 2015 12:08 Go to next message
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 #633500 is a reply to message #633499] Thu, 19 February 2015 12:13 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/


What does above have to do with Oracle database?
Re: New to using Oracle. Need help! [message #633501 is a reply to message #633500] Thu, 19 February 2015 12:23 Go to previous messageGo to next message
jdmas
Messages: 3
Registered: February 2015
Location: California
Junior Member
I am using a database (Cognos I believe) that has some "canned" reports in it. There are fields that I need added (like I mentioned above), and it requires SQL code that I do not fully understand.
Re: New to using Oracle. Need help! [message #633502 is a reply to message #633501] Thu, 19 February 2015 12:36 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
jdmas wrote on Thu, 19 February 2015 13:23
I 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 #633503 is a reply to message #633502] Thu, 19 February 2015 12:38 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
https://www.google.com/webhp?hl=en&tab=ww#hl=en&q=cognos+forum
Re: New to using Oracle. Need help! [message #633504 is a reply to message #633502] Thu, 19 February 2015 12:41 Go to previous messageGo to next message
jdmas
Messages: 3
Registered: February 2015
Location: California
Junior Member
Oh...well if this does not prove how new I am to this, I don't know what will!

Thanks and sorry for the inconvenience!
Re: New to using Oracle. Need help! [message #633505 is a reply to message #633502] Thu, 19 February 2015 12:41 Go to previous message
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:36
jdmas wrote on Thu, 19 February 2015 13:23
I 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.

Previous Topic: To determine if the column value is decreasing
Next Topic: ora-22288
Goto Forum:
  


Current Time: Wed Sep 09 12:50:59 CDT 2026