plsql - Oracle sql last cancel record -


i have below data:

order

order_id    order_name        order_date         order_status   1            iphone        20130102 13:20:00        cancelled 1            blackberry    20130102 13:00:00        cancelled 1            ipad          20130102 13:00:00        cancelled 

person

person_id     person_name       order_id  1             harshini          1 

i want retrieve below data when query based on order_date between 20130102 13:00:00 2013 13:20:00.it means last cancel order.

person_name     order_name   order_date       harshini        blackberry   20130102 13:00:00 

just try this...
select p.person_name ,o.order_name,o.order_status order_1 o,person p orderdate=(select max(orderdate) order_1)


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -