Home » SQL & PL/SQL » SQL & PL/SQL » Merge statement required with Logic
Merge statement required with Logic [message #589774] Wed, 10 July 2013 12:14 Go to next message
na.dharma@gmail.com
Messages: 63
Registered: May 2008
Location: bangalore
Member

Table Name: F_SCENARIO

System : Dataware house

Oracle version : 11g

Record Count : 2 Million records

Correct scenario records

F_Key F_Bridge_key Record_type
1 1 1
2 1 2
3 1 3


Wrong scenario records

F_Key F_Bridge_key Record_type
1 1 1
2 -5 2
3 -6 3

I want to write a Merge statment to update the nagative values into 1, can you please help me to provide some suggestion and query

Please let know if you any confusion in the above data's
Re: Merge statement required with Logic [message #589777 is a reply to message #589774] Wed, 10 July 2013 12:20 Go to previous messageGo to next message
BlackSwan
Messages: 22786
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Merge statement required with Logic [message #589780 is a reply to message #589774] Wed, 10 July 2013 12:27 Go to previous messageGo to next message
Michel Cadot
Messages: 59118
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topics:

cookiemonster wrote on Tue, 09 July 2013 14:16
1) Please read and follow How to use [code] tags and make your code easier to read? the above code is really hard to read.
...


In addition, you do not feedback to the questions we posted you. I'm still waiting for your answer to this.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Regards
Michel
Re: Merge statement required with Logic [message #589781 is a reply to message #589774] Wed, 10 July 2013 12:28 Go to previous messageGo to next message
joy_division
Messages: 4513
Registered: February 2005
Location: East Coast USA
Senior Member
na.dharma@gmail.com wrote on Wed, 10 July 2013 13:14

I want to write a Merge statment to update the nagative values into 1, can you please help me to provide some suggestion and query


how can 1 1 1 be in both correct and incorrect scenario?
no merge necessary.
update table set column=1 where column <0;

this is my answer based on the question
Re: Merge statement required with Logic [message #589783 is a reply to message #589777] Wed, 10 July 2013 12:31 Go to previous messageGo to next message
na.dharma@gmail.com
Messages: 63
Registered: May 2008
Location: bangalore
Member

Hi Swan,

i dont have database access now..that is reason i have given the sample records otherwise i could have given with orginale record sample ...
Re: Merge statement required with Logic [message #589788 is a reply to message #589783] Wed, 10 July 2013 14:04 Go to previous messageGo to next message
Michel Cadot
Messages: 59118
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You don't need any access to the database to post a correct Test case.

Regards
Michel

[Updated on: Wed, 10 July 2013 14:05]

Report message to a moderator

Re: Merge statement required with Logic [message #589790 is a reply to message #589788] Wed, 10 July 2013 14:08 Go to previous message
Bill B
Messages: 1098
Registered: December 2004
Senior Member
CHECK THE MERGE STATEMENT. in google type ORACLE MERGE
Previous Topic: trying to get two values from case stmt (2 Merged)
Next Topic: case statement
Goto Forum:
  


Current Time: Wed Sep 17 15:27:24 CDT 2014

Total time taken to generate the page: 0.10118 seconds