Home » SQL & PL/SQL » SQL & PL/SQL » help in writing query (oracle 11 g)
help in writing query [message #635813] Thu, 09 April 2015 05:33 Go to next message
simplesanju
Messages: 36
Registered: July 2008
Member
table structure refrence_yield

rc code amount version, updated_dt
e1w G1 100 1 9-04-15
e1w g2 200 1 9-04-15
e1w g1 150 2 7-04-15
e1w G2 350 2 7-04-15
e1w g1 165 1 7-04-15
e1w g2 165 1 7-04-15
e1w G1 205 1 6-04-15
e1w G2 340 1 6-04-15
e1n Y1 150 2 9-04-15
e1n Y2 125 2 9-04-15


means if any body update amount of code from screen these records insert into table with ne incremented version. but if date change version start again from 1.

needed output:

last two updats for evry rc we want to fectch

rc code new_velue previous value
e1w G1 100 150
e1w G2 200 350
e1n Y1 150 null
e1n Y2 125 null

Thanks in advance
sanjana
Re: help in writing query [message #635814 is a reply to message #635813] Thu, 09 April 2015 05:54 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Please read and follow the OraFAQ Forum Guide and How to use [code] tags, to enable us to help you.

Post the create and insert statements. Just desc the table or showing the data is not going to help us. It will require reverse engineer and construct the table and data.
Re: help in writing query [message #635822 is a reply to message #635813] Thu, 09 April 2015 07:43 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Also check your keyboard, it seems some keys do not properly work.

[Updated on: Thu, 09 April 2015 07:43]

Report message to a moderator

Previous Topic: Materialized is getting invalid after refresh
Next Topic: SQL
Goto Forum:
  


Current Time: Fri Apr 19 18:54:57 CDT 2024